Rocky Linux is the most popular Linux distribution that was developed by the Rocky Enterprise Software Foundation. It is intended to be a full, downstream, and binary-compatible release that uses the Red Hat Enterprise Linux operating system source code. It is a common practice to upgrade your existing rocky Linux distribution from 8.x to 9. So, you don’t need to install a separate release on your system. You can upgrade your existing Linux distribution to the newest version.
This guide will demonstrate to you how to upgrade from Rocky Linux 8.7(Green obsidian) to Rocky Linux 9.0 (Blue Oynx) using the command line.
Upgrade Rocky Linux from 8.x to Rocky Linux 9.0 version
You can upgrade your existing Rocky Linux 8.x Linux system to Rocky Linux 9.0 by using the following steps:
Important Note: It is advised that before starting the upgrading procedure, back up all of your important data on the server.
Step 1: Update the repository packages
Make sure that all installed software packages running the latest release of Rocky Linux 8. However, it is good practice to update package repositories by using this command:
1 |
# dnf update |
Step 2: Check the installed Rocky Linux release
Now, display the information of the installed Rocky Linux release by using the following command:
1 |
# cat /etc/os-release |
As we can see, the Rocky Linux 8.7 (Green Obsidian) release is installed on this system.
Step 3: Add and install Rocky Linux 9 Repositories
In this step, you will add and install the Rocky Linux 9 repositories. For example, you need to add rocky-release, rocky-repos, and rocky-gpg-keys to your system. To install all these repositories, use the following commands:
1 |
# dnf install <a href="https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-release-9.0-2.3.el9.noarch.rpm" target="_blank" rel="noopener noreferrer">https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-release-9.0-2.3.el9.noarch.rpm</a> |
1 |
# dnf install <a href="https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-repos-9.0-2.3.el9.noarch.rpm" target="_blank" rel="noopener noreferrer">https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-repos-9.0-2.3.el9.noarch.rpm</a> |
1 |
# dnf install <a href="https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-gpg-keys-9.0-2.3.el9.noarch.rpm" target="_blank" rel="noopener noreferrer">https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/rocky-gpg-keys-9.0-2.3.el9.noarch.rpm</a> |
If you already have added the above repository, use the ‘–skip-broken’ with all commands to ignore any conflict or resolve dependencies.
Now, remove the directory ‘/usr/share/redhat-logos’ manually before upgrading your Rocky Linux distro:
1 |
# rm -rf /usr/share/redhat-logos |
Step 4: Upgrade from Rocky Linux 8.7 to Rocky Linux 9
Now, your system is ready, and it’s time to upgrade your Rocky Linux 8 system to Rocky Linux 9. To do this, use the following command:
1 |
# dnf --releasever=9 --allowerasing --setopt=deltarpm=false distro-sync |
The above command will resolve all dependencies and conflicts.
Moreover, this command will download and install the all required packages that are necessary for the upgrade process.
Step 5: Rebuild the RPM database
As we upgraded this Linux distribution to Rocky Linux 9 which uses SQLite in the backend. So, it is recommended that rebuild the rpm database using the following command:
1 |
# rpm --rebuilddb |
Step 6: Reboot the system
At the end of this process, reboot your system using this command:
1 |
# reboot |
Finally, your rocky Linux 8.x distribution upgraded to Rocky Linux 9. Now, you can log in to the newest Rocky Linux 9 server once the system has successfully booted.
Conclusion
This guide demonstrated to you how to upgrade your Linux distribution from Rocky Linux release 8.x to 9. And once again, the official recommendation from Rocky Linux on this problem is to run a clean install on a new Rocky Linux 9 machine.