Reputation: 71
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 ?
Upvotes: 5
Views: 34967
Reputation: 11
Try this to install Jenkins on a Debian host, it should fix your problem:(you can hit all cmds in one short)
sudo apt update
sudo apt install default-jdk
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt-get update
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
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
For more info, refer this: https://www.jenkins.io/doc/book/installing/linux/#debianubuntu
Upvotes: 0
Reputation: 1
Please try this. It's from the official jenkins documentation. Later maybe if you find another error it could be because maybe your 8080 port is not free. In this case, you have to kill the process and run as root user.
wget -O /usr/share/keyrings/jenkins-keyring.asc \ https://pkg.jenkins.io/debian/jenkins.io-2023.key
echo "deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]" \ https://pkg.jenkins.io/debian binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
apt-get update
apt-get install jenkins
You can refer to (weekly release): https://www.jenkins.io/doc/book/installing/linux/
Upvotes: 0
Reputation: 1
Step 1: Add the Jenkins repository key
curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee /usr/share/keyrings/jenkins-keyring.asc > /dev/null
Step 2: Add the Jenkins repository
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
Step 3: Update and Install Jenkins
sudo apt update
sudo apt install jenkins -y
Upvotes: 0
Reputation: 844
Hope this helps someone. Below is what that worked out for me
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.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/nullsudo apt update
sudo apt install jenkins
Upvotes: 0
Reputation: 1
Try this:
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
Upvotes: 0
Reputation: 11
Don't worry, I have faced that issue (E: Package 'jenkins' has no installation candidate) on Ubuntu 20.
It is working now
● jenkins.service - Jenkins Continuous Integration Server Loaded: loaded (/lib/systemd/system/jenkins.service; enabled; vendor preset: enabled) Active: active (running) since Sat 2024-02-10 05:47:08 UTC; 16s ago Main PID: 2289311 (java) Tasks: 50 (limit: 4686)
Just run the below commands:-
sudo apt dist-upgrade
wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt update
sudo apt install jenkins
systemctl status jenkins
Upvotes: 1
Reputation: 381
✅E: Package jenkins has no installation candidate
100% SOLVED💯
As from June 2022 & later, Jenkins installation process was updated with newer & safer keys, hence the error E: Package 'jenkins' has no installation candidate
So to resolve this and gracefully install jenkins, the CICD automation server, follow these 3 simple steps:
1. Update your local packages repository as sudo then add new keys (2023 Update) to the system.
$ sudo apt-get update
$ curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \ /usr/share/keyrings/jenkins-keyring.asc > /dev/null
2. Then add a Jenkins apt repository entry:
$ echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \ https://pkg.jenkins.io/debian binary/ | sudo tee \ /etc/apt/sources.list.d/jenkins.list > /dev/null
3. Update your local package index, install the JDK-17-JRE (2023 or newer) then finally install Jenkins:
$ sudo apt-get update
$ sudo apt-get install fontconfig openjdk-17-jre
$ sudo apt-get install jenkins
To keep track of the ever-evolving DevSecOps world, kindly refer to the Official Jenkins installation guide.
Upvotes: 0
Reputation: 81
Just run this code step by step it will
sudo apt update
sudo apt install openjdk-17-jre
java -version
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.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
sudo systemctl start jenkins.service
sudo systemctl status jenkins
Upvotes: 8
Reputation: 1
First Install ca-certificate 1: sudo apt install ca-certificates 2: then install Jenkins from the official documentation https://www.jenkins.io/doc/book/installing/linux/#debianubuntu
Upvotes: 0
Reputation: 1
first command 1.
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
Then add a Jenkins apt repository entry: second command:-
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
run these it worked for me
sudo apt-get update
sudo apt-get install fontconfig openjdk-11-jre
sudo apt-get install jenkins
Upvotes: 0
Reputation: 121
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.
Upvotes: 5
Reputation: 31
install ca-certificates.
sudo apt install ca-certificates
then install Jenkins from the official documentation
https://www.jenkins.io/doc/book/installing/linux/#debianubuntu
Upvotes: 1
Reputation: 151
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,
deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian binary/
Update it as,
deb [trusted=yes] https://pkg.jenkins.io/debian binary/
After that run the installation instructions.
Eg: for Debian releases
sudo apt-get update
sudo apt-get install fontconfig openjdk-11-jre
sudo apt-get install jenkins
Upvotes: 10
Reputation: 21
switch to root user first. Command: sudo su -
Then you can run the commands you ran earlier to install Jenkins. It should work now.
Upvotes: 2
Reputation: 21
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
Upvotes: 2