Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Servers, nginx and Docker

yum or dnf refuses the Jenkins package after the signing key changed

Your error

Public key for jenkins-2.387.2-1.1.noarch.rpm is not installed3 more lines it can show

Fix it fast

Most common cause, 1 of 3

Only the previous Jenkins key is imported

Import the current key for your release line, then upgrade.

Fix
# LTS
sudo rpm --import https://pkg.jenkins.io/rpm-stable/jenkins.io-2026.key
# weekly
sudo rpm --import https://pkg.jenkins.io/rpm/jenkins.io-2026.key
sudo dnf upgrade jenkins    # or: sudo yum upgrade jenkins
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

yum and dnf say the public key for jenkins-<version>.noarch.rpm is not installed because Jenkins replaces its repository signing key every 3 years, and packages from weekly 2.543 and LTS 2.541.1 on are signed with jenkins.io-2026.key. Import it with sudo rpm --import https://pkg.jenkins.io/rpm-stable/jenkins.io-2026.key, then run the upgrade again. Applies to LTS 2.580.2.

  • Applies to Jenkins LTS 2.580.2 and weekly releases from 2.543, yum and dnf 4 on Red Hat Enterprise Linux and derivatives, apt on Debian and Ubuntu
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

Look at whether the Jenkins repo file names a key URL, and which public keys rpm already holds. No gpgkey line plus the 'Public key ... is not installed' message is cause 1; a gpgkey line plus 'already installed but they are not correct' is cause 2. On Debian or Ubuntu go straight to cause 3.

Run this first
grep -E "^(baseurl|gpgkey)" /etc/yum.repos.d/jenkins.repo
rpm -q gpg-pubkey

Then find the line you see in this list and open its fix:

  1. 1Only the previous Jenkins key is importedjenkins.repo has no gpgkey= line, and the upgrade ends with 'Public key for jenkins-<version>.noarch.rpm is not installed' without offering to import a key
  2. 2The repo file still points gpgkey at an old key filednf prints 'GPG key at ... is already installed' for the listed key and then stops with 'already installed but they are not correct for this package'
  3. 3On Debian or Ubuntu, the keyring file holds the old keyapt-get update warns that signatures couldn't be verified with NO_PUBKEY 7198F4B714ABFC68 and calls the Jenkins repository not signed

What does the error look like?

  • Public key for jenkins-2.387.2-1.1.noarch.rpm is not installed
  • The GPG keys listed for the "Jenkins-stable" repository are already installed but they are not correct for this package.
  • Check that the correct key URLs are configured for this repository.
  • NO_PUBKEY 7198F4B714ABFC68

Cause 1 of 3

Only the previous Jenkins key is imported

You seejenkins.repo has no gpgkey= line, and the upgrade ends with 'Public key for jenkins-<version>.noarch.rpm is not installed' without offering to import a key

Check

dnf stops with this message when the package's signature belongs to a key missing from the rpm database and the repository names no gpgkey it could import from. Jenkins started signing with a new repository key in December 2025 for weekly 2.543 and in January 2026 for LTS 2.541.1, so a server that only ever imported the older key cannot check newer packages.

Check
sudo dnf upgrade jenkins 2>&1 | grep -i "public key"

Fix

Import the current key for your release line, then upgrade. The LTS line reads from rpm-stable; the weekly line reads from rpm.

Fix
# LTS
sudo rpm --import https://pkg.jenkins.io/rpm-stable/jenkins.io-2026.key
# weekly
sudo rpm --import https://pkg.jenkins.io/rpm/jenkins.io-2026.key
sudo dnf upgrade jenkins    # or: sudo yum upgrade jenkins

Verify

The upgrade finishes and rpm reports the new Jenkins version.

Verify
rpm -q jenkins

Confirmed by jenkins.io

Did this fix it?

Cause 2 of 3

The repo file still points gpgkey at an old key file

You seednf prints 'GPG key at ... is already installed' for the listed key and then stops with 'already installed but they are not correct for this package'

Check

dnf raises this error when every key listed in the repository's gpgkey= line is already in the database and none of them signed the package. Its own text says to check the key URLs configured for the repository, so the .repo file is the thing to fix, not the package.

Check
grep -n "gpgkey" /etc/yum.repos.d/jenkins.repo

Fix

Download the repo file again from the Jenkins installation guide. The current file for the LTS line sets baseurl to https://pkg.jenkins.io/rpm-stable and gpgkey to that repository's repodata/repomd.xml.key, with gpgcheck and repo_gpgcheck on. Use pkg.jenkins.io/rpm/jenkins.repo for weekly releases.

Fix
sudo wget -O /etc/yum.repos.d/jenkins.repo \
  https://pkg.jenkins.io/rpm-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/rpm-stable/jenkins.io-2026.key
sudo dnf clean all
sudo dnf upgrade jenkins

Verify

dnf reads the Jenkins repository without a GPG prompt that fails, and the package installs.

Verify
sudo dnf info jenkins

Confirmed by raw.githubusercontent.com

Did this fix it?

Cause 3 of 3

On Debian or Ubuntu, the keyring file holds the old key

You seeapt-get update warns that signatures couldn't be verified with NO_PUBKEY 7198F4B714ABFC68 and calls the Jenkins repository not signed

Check

The same key change hits apt. The signed-by option in /etc/apt/sources.list.d/jenkins.list names the keyring file apt trusts for Jenkins; depending on the install date it is /etc/apt/keyrings/jenkins-keyring.asc or /usr/share/keyrings/jenkins-keyring.asc. That file still contains the previous key.

Check
grep -o 'signed-by=[^] ]*' /etc/apt/sources.list.d/jenkins.list

Fix

Write the current key into the file that signed-by names. Use debian-stable for LTS and debian for weekly. If the grep printed nothing, the repository was added with apt-key; create /etc/apt/keyrings, download the key there and rewrite jenkins.list with a signed-by entry.

Fix
sudo wget -O /etc/apt/keyrings/jenkins-keyring.asc \
  https://pkg.jenkins.io/debian-stable/jenkins.io-2026.key
sudo apt-get update
sudo apt-get install --only-upgrade jenkins

Verify

apt-get update shows no GPG error for pkg.jenkins.io, and dpkg reports the new version.

Verify
dpkg-query --show jenkins

Confirmed by jenkins.io

Did this fix it?

How do I stop it coming back?

  • Add the key import to the same provisioning script or Ansible role that writes the Jenkins repo file, so new servers always get both.
  • Follow the Jenkins blog or changelog for repository signing key announcements; the key is replaced on a 3-year cycle.
  • Never switch off gpgcheck to get past the error, since that removes the check that the package really comes from Jenkins.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.