How to upgrade Rocky Linux from 8.5 to 9 utilizing the CLI


Jack Wallen takes you through the simple steps of upgrading Rocky Linux to the most recent significant release.

computer login 01 Image: Adobe Stock Rocky Linux has rapidly end up being a beloved of the open source industry, poised to help users and admins alike totally forget that CentOS ever lived on their servers and information centers. Rocky Linux is as fine a server OS as you’ll ever utilize and has all however been ensured that it will never go away.

But, like all running systems, you’re going to need to upgrade. Why? Security patches, bug fixes and brand-new features. I realize lots of admins are reluctant to move their production servers from one release to another which’s a reasonable proposal. After all, whatever is working to perfection, so why would you want to risk it? Similar to any os, with major updates come significant functions.

SEE: 40+ open source and Linux terms you require to understand (TechRepublic Premium)

For example, Rocky Linux 9 ships with OpenSSL 3.0.1 and OpenSSH 8.7.01 and includes automatic setup compliance settings for PCI-DSS, HIPAA and DISA. There’s likewise Node.js 16, Perl 5.32, PHP 8.0, Python 3.9 and Ruby 3.0. There are a lot of reasons to upgrade from 8.x to 8.

Think it or not, this isn’t all that challenging. Let’s dive in and discover.

What you’ll need to update Rocky Linux

The only things you’ll require for this are a running circumstances of Rocky Linux 8.x and a user with sudo benefits. That’s all, folks. Time to work.

Back up, back up, back up

Before you do this, make sure to back up any crucial data on the server. You can do this with tar or any backup service you use– simply ensure you make sure to save those backups on an external drive.

Must-read designer protection

If tar is your solution of choice, you could merely back up everything minus non-data-containing directories with a single command. State you have an external drive installed to/ information. You could back everything up with:

sudo tar czf/ data/rocky _ backup.tar.gz– omit=/ rocky8.tar.gz– omit=/ dev– exclude=/ mnt– leave out=/ proc– leave out=/ sys– leave out=/ run– omit=/ tmp– omit=/ media– leave out=/ lost+found/

Once you’re pleased with the backup, time to upgrade.

How to update Rocky Linux

The first thing you need to do is update all currently installed software with the command:

sudo dnf upgrade

As soon as the upgrade finishes reboot the system.

Next, we need to add the Rocky Linux 9 repositories. We can do this by first setting a couple of variables to define package numbers with the following commands, ensuring to examine this site for the most recent releases:


RELEASE_PKG=”rocky-release-9.0 -2.3. el9.noarch.rpm”

REPOS_PKG=”rocky-repos-9.0 -2.3. el9.noarch.rpm”

GPG_KEYS_PKG=”rocky-gpg-keys-9.0 -2.3. el9.noarch.rpm”

Install the needed bundles with:


Eliminate the redhat-logos directory, otherwise the upgrade will stop working, with the command:

sudo rm -rf/ usr/share/redhat-logos

Lastly, upgrade Rocky Linux from 8.x to 9 with:

sudo dnf– releasever=9– allowerasing– setopt=deltarpm=false distro-sync -y

After the installation completes, restore the RPM database with:

sudo rpm– rebuilddb

Once everything is taken care of, reboot the system and log into Rocky Linux 9.

Congratulations, you have actually simply updated from Rocky Linux 8.x to 9. I extremely recommend you test this process on a non-production maker, before diving into your information center with the above commands. As soon as you are comfy with the procedure, go on and run it on your production servers and take pleasure in those new functions and enhancements.

Sign up for TechRepublic’s How To Make Tech Work on YouTube for all the latest tech guidance for business pros from Jack Wallen.


Leave a Reply

Your email address will not be published. Required fields are marked *