Cyberithub

[Solved]: repository 'http://pkg.jenkins.io/debian-stable binary/ Release' is not signed

Advertisements

In this article, we will see how to solve "The repository 'http://pkg.jenkins.io/debian-stable binary/ Release' is not signed" error. You might have observed this error during installation of Jenkins in your Linux based servers. This error precisely comes when you try to run either sudo apt update or sudo apt-get update command on Ubuntu/Debian based systems just after adding Jenkins repo. So if you are also facing this error then don't worry. Here we will see the exact cause of this problem along with the steps to solve the error.

 

[Solved]: repository 'http://pkg.jenkins.io/debian-stable binary/ Release' is not signed

[Solved]: repository 'http://pkg.jenkins.io/debian-stable binary/ Release' is not signed

Also Read: How to Permanently Change hostname in Linux

Advertisements

To understand this error further, let's take an example of my situation where I faced this error during installation of Jenkins on my Ubuntu 20.04 LTS system. After adding Jenkins repo when I ran sudo apt update command then it shown "The repository 'http://pkg.jenkins.io/debian-stable binary/ Release' is not signed" error on the output as shown below.

cyberithub@ubuntu:~$ sudo apt update
Hit:1 https://d3nt0h4h6pmmc4.cloudfront.net/ubuntu focal InRelease
Get:2 https://repositories.timber.io/public/vector/deb/ubuntu focal InRelease [4,947 B]
Hit:3 https://dl.google.com/linux/chrome/deb stable InRelease
Hit:4 https://dl.winehq.org/wine-builds/ubuntu focal InRelease
Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:7 http://ppa.launchpad.net/flatpak/stable/ubuntu focal InRelease
Hit:8 http://in.archive.ubuntu.com/ubuntu focal InRelease
Ign:6 https://pkg.jenkins.io/debian-stable binary/ InRelease
Hit:9 https://download.sublimetext.com apt/stable/ InRelease
Hit:10 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 InRelease
Get:11 https://pkg.jenkins.io/debian-stable binary/ Release [2,044 B]
Get:12 https://pkg.jenkins.io/debian-stable binary/ Release.gpg [833 B]
Hit:13 https://ngrok-agent.s3.amazonaws.com buster InRelease
Get:14 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Hit:15 http://ppa.launchpad.net/gencfsm/ppa/ubuntu focal InRelease
Hit:16 http://ppa.launchpad.net/juju/stable/ubuntu focal InRelease
Hit:17 http://ppa.launchpad.net/libreoffice/ppa/ubuntu focal InRelease
Hit:18 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:19 http://ppa.launchpad.net/mojo-maintainers/ppa/ubuntu focal InRelease
Ign:12 https://pkg.jenkins.io/debian-stable binary/ Release.gpg
Hit:20 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal InRelease
Reading package lists... Done
W: GPG error: https://pkg.jenkins.io/debian-stable binary/ Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 5BA31D57EF5975CA
E: The repository 'http://pkg.jenkins.io/debian-stable binary/ Release' is not signed.
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.

Above error occurs due to either expired or non-availability of repository signing keys in your linux system. So to fix the issue, you have to download and install the new signing keys from Jenkins official website for the linux flavor you are currently using. For example, in my case I am using stable Debian/Ubuntu based linux system, so I have to use below command to download the latest signing key.

Advertisements
cyberithub@ubuntu:~$ curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
> /usr/share/keyrings/jenkins-keyring.asc > /dev/null

Then install it by using below command.

cyberithub@ubuntu:~$ 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

If you are using debian/ubuntu weekly release then use below command.

Advertisements
curl -fsSL https://pkg.jenkins.io/debian/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 binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null

If we run sudo apt update command again then this time you will notice that it is not showing same error as before as you can see below. You should be able to proceed with the Jenkins installation.

cyberithub@ubuntu:~$ sudo apt update
Ign:1 https://pkg.jenkins.io/debian-stable binary/ InRelease
Get:2 https://pkg.jenkins.io/debian-stable binary/ Release [2,044 B]
Get:3 https://pkg.jenkins.io/debian-stable binary/ Release.gpg [833 B]
Get:4 https://pkg.jenkins.io/debian-stable binary/ Packages [25.8 kB]
Hit:5 https://dl.google.com/linux/chrome/deb stable InRelease
Get:6 https://repositories.timber.io/public/vector/deb/ubuntu focal InRelease [4,947 B]
Hit:7 http://ppa.launchpad.net/flatpak/stable/ubuntu focal InRelease
Hit:8 https://d3nt0h4h6pmmc4.cloudfront.net/ubuntu focal InRelease
Hit:9 https://dl.winehq.org/wine-builds/ubuntu focal InRelease
Hit:10 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:11 http://ppa.launchpad.net/gencfsm/ppa/ubuntu focal InRelease
Hit:12 https://ngrok-agent.s3.amazonaws.com buster InRelease
Hit:13 https://ftp.postgresql.org/pub/pgadmin/pgadmin4/apt/focal pgadmin4 InRelease
Hit:14 http://ppa.launchpad.net/juju/stable/ubuntu focal InRelease
Hit:15 http://ppa.launchpad.net/libreoffice/ppa/ubuntu focal InRelease
Hit:16 http://in.archive.ubuntu.com/ubuntu focal InRelease
Hit:17 http://in.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:18 http://ppa.launchpad.net/mojo-maintainers/ppa/ubuntu focal InRelease
Hit:19 http://in.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:20 https://download.sublimetext.com apt/stable/ InRelease
Hit:21 http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu focal InRelease
Fetched 33.6 kB in 4s (9,583 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
16 packages can be upgraded. Run 'apt list --upgradable' to see them.

Similarly, if you are using RHEL/CentOS/Fedora/Rocky Linux based systems, then you have to use below command to download and install the repository signing keys.

Advertisements

LTS Release

sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key

 

Weekly Release

sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io-2023.key

Leave a Comment