FIXED: Unable to install Jenkins on Ubuntu 20.04

FIXED: Unable to install Jenkins on Ubuntu 20.04

FIXED: Unable to install Jenkins on Ubuntu 20.04

Jenkins Oct 29, 2022

On running following command, it shows error.

sudo apt update
sudo apt install openjdk-8-jdk 
wget -q -O - | sudo apt-key add - 
sudo sh -c 'echo deb binary/ > /etc/apt/sources.list.d/jenkins.list' 
sudo apt update

It is showing this error on screen.

root@ip-###-##-##-###:~# sudo apt update Ign:1 binary/ InRelease Err:2 binary/ Release Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate. Could not handshake: Error in the certificate verification. [IP: 443] Hit:3 focal InRelease Get:4 focal-updates InRelease [114 kB] Get:5 focal-security InRelease [114 kB] Get:6 focal-backports InRelease [101 kB] Reading package lists... Done E: The repository ' binary/ Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.

Ubuntu 20.04
AWS ec2 Instance/DigitalOcean Droplet

When I attempted to install Jenkins in an AWS EC2 instance, I had the identical problem (Ubuntu 20.04). I found the methods below helpful.

1. Update Ubuntu packages and all installed applications

sudo apt-get update -y
sudo apt-get upgrade -y

2. Next, Install JDK

sudo apt install openjdk-11-jdk -y

3. Verify Java version

java -version

4. Add gpg key for jenkins installation

wget -q -O - | apt-key add -

5. Add the repository address to our /etc/apt/sources.list.d file

sudo sh -c 'echo deb binary/ > \
e>     /etc/apt/sources.list.d/jenkins.list'

6. Update our package list again

sudo apt-get update -y

7. Install Jenkins

sudo apt-get install jenkins -y

Done! Now it will start working.



Anurag Deep

Logical by Mind, Creative by Heart