so im trying to install the jenkins on my ubuntu and ofc i made sure to update the system by running : apt update
then i tried to run the following commands from jenkins website to install jenkins :
"
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]
https://pkg.jenkins.io/debian-stable binary/ | sudo tee
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins
then i got an error message that says :
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package jenkins is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package jenkins has no installation candidate
i barely understood, is that trying to recognize the repo which the files are downloading from?
i saw a youtube video of someone who had the same problem and he use the following commands:
wget -q -O - https://pkg.jenkins.io/debian-stable/... | sudo apt-get key add
'sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/>/etc/apt/sources.list.d/jenkind.list
sudo apt-get update
sudo apt-get install jenkins
but it still doesnt work for me
can you help me please get jenkins installed ?
6
Answers
Follow below commands to install the Jenkins in the ubuntu 18:04
command1 :
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
command2 :
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]
https://pkg.jenkins.io/debian-stable binary/ | sudo tee
/etc/apt/sources.list.d/jenkins.list > /dev/null
command3:
sudo apt-get update
sudo apt-get install jenkins
sudo systemctl status jenkins
Access the URL http://hostname:8080
use the below command to get the password
more /var/lib/jenkins/secrets/initialAdminPassword
switch to root user first.
Command: sudo su –
Then you can run the commands you ran earlier to install Jenkins. It should work now.
You can add
[trusted=yes]
in the/etc/apt/sources.list.d/jenkins.list
file.Initially
/etc/apt/sources.list.d/jenkins.list
will have,Update it as,
After that run the installation instructions.
Eg: for Debian releases
install ca-certificates.
sudo apt install ca-certificates
then install Jenkins from the official documentation
https://www.jenkins.io/doc/book/installing/linux/#debianubuntu
I too had this problem and the issue was because I was using Zsh and not Bash. Once I switched to Bash (by typing "bash") the commands on the Jenkins website to install on Linux (Ubuntu for me) actually worked.
first command
1.
Then add a Jenkins apt repository entry:
second command:-
run these it worked for me