How to Fix Jenkins NO_PUBKEY 7198F4B714ABFC68 on Ubuntu 24.04
Refreshing the package index on Ubuntu 24.04 with Jenkins LTS installed may show a NO_PUBKEY error that blocks updates and makes it impossible to update Jenkins.
sudo apt update
The following error may appear:
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. 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 7198F4B714ABFC68
W: Failed to fetch https://pkg.jenkins.io/debian-stable/binary/Release.gpg The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 7198F4B714ABFC68
W: Some index files failed to download. They have been ignored, or old ones used instead.
This happens because of a recent signing keys update by Jenkins.
To resolve this issue on Ubuntu 24.04, update the signing keys. Run the two commands below:
Note: The second command overwrites
/etc/apt/sources.list.d/jenkins.list. Back up the file first if it contains custom configuration.
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2026.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
Then run the package update again:
sudo apt update
The package update will work correctly with the Jenkins APT repository:
...
Ign:5 https://pkg.jenkins.io/debian-stable binary/ InRelease
Get:6 https://pkg.jenkins.io/debian-stable binary/ Release [2,044 B]
Get:7 https://pkg.jenkins.io/debian-stable binary/ Release.gpg [833 B]
Get:8 https://pkg.jenkins.io/debian-stable binary/ Packages [30.5 kB]
...
After upgrading packages:
sudo apt upgrade
The new version of Jenkins will be downloaded, unpacked, and installed.
...
Get:15 https://pkg.jenkins.io/debian-stable binary/ jenkins 2.541.1 [95.8 MB]
...
Preparing to unpack .../00-jenkins_2.541.1_all.deb ...
Unpacking jenkins (2.541.1) over (2.528.3) ..
...
Setting up jenkins (2.541.1) ...
...
After logging into Jenkins, Jenkins 2.541.1 will be displayed in the bottom right corner.