Linux

This page explains how to upgrade Jenkins installed from the Jenkins Linux packages, as described separately in Installing Jenkins on Linux. Follow the steps in Before upgrading first.

Use the package manager

Upgrade a package installation with the package manager of your operating system (apt, dnf, or yum). Do not replace the jenkins.war file with a downloaded copy.

The Jenkins package installs jenkins.war as /usr/share/java/jenkins.war, and that file belongs to the package. If you replace it, the package manager still reports the old version, and the next package upgrade overwrites your copy. The package also installs the files that start Jenkins, such as the jenkins systemd service, and upgrades them together with jenkins.war.

When the package is upgraded, the package manager restarts Jenkins if it is running.

Update the repository signing key

The Jenkins package repositories are signed with a key that is replaced before it expires, which happens every 3 years. If your system still has a previous key, the package manager would refuse to read the repository, and Jenkins would not be upgraded in that case. On Debian and Ubuntu, apt-get update reports an error like this:

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 7198F4B714ABFC68
E: The repository 'https://pkg.jenkins.io/debian-stable binary/ Release' is not signed.

Remember to install the current key before upgrading. The commands below use the key introduced in the Jenkins weekly 2.543 and LTS 2.541.1, as announced in New Linux Repository Signing Keys. The installation guide shows the current key.

Debian/Ubuntu

The signed-by option in /etc/apt/sources.list.d/jenkins.list names the key file that apt uses for the Jenkins repository. Depending on when Jenkins was installed, this is either /etc/apt/keyrings/jenkins-keyring.asc or /usr/share/keyrings/jenkins-keyring.asc. Find it with:

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

Then download the current key to that file. For example, if the file is /etc/apt/keyrings/jenkins-keyring.asc and you use the LTS release:

sudo wget -O /etc/apt/keyrings/jenkins-keyring.asc \
  https://pkg.jenkins.io/debian-stable/jenkins.io-2026.key

For the weekly release, download the key from pkg.jenkins.io/debian/jenkins.io-2026.key instead.

If the command produces no output, this means that the repository was configured without any signed-by (such as older installations using apt-key). Migrate the repository definition to signed-by by creating the keyrings directory, downloading the key, and rewriting the repository entry as follows:

sudo mkdir -p /etc/apt/keyrings
sudo wget -O /etc/apt/keyrings/jenkins-keyring.asc \
  https://pkg.jenkins.io/debian-stable/jenkins.io-2026.key
echo "deb [signed-by=/etc/apt/keyrings/jenkins-keyring.asc]" \
  https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
  /etc/apt/sources.list.d/jenkins.list > /dev/null

For the weekly release, replace instances of debian-stable with debian in both commands. For more details, see the key-rotation instructions in New Linux Repository Signing Keys.

Fedora, Red Hat Enterprise Linux, and derivatives

Import the current key for the LTS release:

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

For the weekly release, import pkg.jenkins.io/rpm/jenkins.io-2026.key instead.

Upgrade Jenkins

Debian/Ubuntu

sudo apt-get update
sudo apt-get install --only-upgrade jenkins

Fedora

sudo dnf upgrade jenkins

Red Hat Enterprise Linux and derivatives

sudo yum upgrade jenkins

Upgrading to a specific version

These commands upgrade to the newest version in the repository. To upgrade to a particular newer version instead, such as an LTS release that is not the newest one, name the version:

# Debian/Ubuntu
sudo apt-get install jenkins=2.580.2
# Fedora
sudo dnf install jenkins-2.580.2
# Red Hat Enterprise Linux and derivatives
sudo yum install jenkins-2.580.2

The repository you configured determines which versions are available: the LTS repository contains the LTS releases, and the weekly repository contains the weekly releases. To move from one release line to the other, see Switching Between Release Lines.

Verify the upgrade

Check that Jenkins is running:

sudo systemctl status jenkins

Check the installed package version:

# Debian/Ubuntu
dpkg-query --show jenkins
# Fedora, Red Hat Enterprise Linux, and derivatives
rpm -q jenkins

Then follow the steps in After upgrading.



Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.