Updating Jenkins on a Rocky8 Platform

Here is a sample “Day in the life of a sys admin” post. We set up Jenkins yet hardly use it. We lock it down and patch it sure but using it is mainly the senior developers : they set up the jobs here. That leaves regular updating of jenkins to us sysadmins. Here’s a sample of what is involved today.

I’ve set up jenkins so its using packages, so really a “dnf update jenkins” should do it and to be fair normally does. There has been scares int he past based around obsolete or broken plugins and you can be pushed to roll-back which can be worrisome (if you let it).

Just for information, I use the repo file. I say this because you can use the GUI do manually update jenkins. But I want the LTS stable platform.

[jenkins]
name=Jenkins-stable
baseurl=http://pkg.jenkins.io/redhat-stable
gpgcheck=1

So stopping Jenkins is either with https://<your jenkins/exit or systemctl stop jenkins

I like to take an archive of the current installation – it seems to be all under directory /usr/lib/jenkins by default:

cd /var/lib/jenkins
rm jenkins-tmp-backup.tgz
tar zcf jenkins-tmp-backup.tgz jenkins/

And then patch along with the operating system and anything else you have runnng:

dnf update -y
systemct  reboot

Every update is different in the following sense. This time it warns me to update java as java11 is end of life next summer. So:

dnf install java-17-openjdk java-17-openjdk-devel
alternatives --list   |grep java
altineratives --config java
systemctl restart jenkins

Lots of plugins (over 100) need updating, but I’ve been here before and its reliable. Select all update and and restart.

I’m still left with three that it says are likely to be obsolete. I’ve spoken to the developers and it’s not them using so these plugins, it might be dependencies from older versions of Jenkins. Anyway I disable them and delete them a week later.

That’s it for me so can be a little intimidating but only rarely is it in a heap.