Rocky Linux

How to Upgrade Rocky Linux 8 to Rocky Linux 9

Rocky Linux is an excellent OS that is widely used in various areas such as cloud computing, web hosting, virtualization, etc. Rocky Linux is well-known for its reliability, security, and stability which makes this OS the best choice for organizations and individuals. The latest version of Rocky Linux is Rocky Linux 9 which is released in 2022. Although Rocky Linux 9 exists, many users still have the Rocky Linux 8 in their system.

The reason is simple: Rocky Linux 8 has fewer bugs and higher compatibility. However, Rocky Linux 9 has some new features including improved privacy and performance. Hence, it is great to upgrade your current Rocky Linux 8 to 9.

In this article, we will describe the simple ways to upgrade Rocky Linux 8 to Rocky Linux 9.

How to Upgrade Rocky Linux 8 to Rocky Linux 9

The latest version of Rocky Linux 8 is 8.7 (released on November 14, 2022) whereas the newest version of Rocky Linux 9 is 9.1 (released on November 26, 2022). That’s why we will explain the process of upgrading Rocky Linux 8.x to Rocky Linux 9.x.

First, it is essential to take a backup of your storage before upgrading Rocky Linux, or else you may lose your data. Once you are done, run the following commands to update the system to the latest one:

sudo dnf upgrade --refresh

The previous command updates the package list and upgrades the available packages. Moreover, the refresh option instructs the package manager to refresh the package list before the upgrade.

Now, it is time to upgrade gpg-keys, repos, and rocky-release. Hence, run the following command to upgrade them all:

dnf install -y https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/{rocky-gpg-keys-9.1-1.11.el9.noarch.rpm,rocky-release-9.1-1.11.el9.noarch.rpm,rocky-repos-9.1-1.11.el9.noarch.rpm}

In the previous command, we entered the following details:

Repo URL: https://download.rockylinux.org/pub/rocky/9/BaseOS/x86_64/os/Packages/r/

Release_Package: rocky-release-9.1-1.11.el9.noarch.rpm

Repos_Package: rocky-repos-9.1-1.11.el9.noarch.rpm

GPG_Keys_Package: rocky-gpg-keys-9.1-1.11.el9.noarch.rpm

Currently, the latest repo package is 9.1-1.11. But make sure that you check out the official website of Rocky Linux 9 to verify the latest repo package.

Once you are done, remove the redhat-logos because it plays an important role while upgrading the system:

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

After the successful configuration, run the following command to install the Rocky Linux 9:

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

Now, run the following command to convert the database and finalize the changes:

sudo rpm --rebuilddb

Finally, reboot the system. You can now access the Rocky Linux 9.

Conclusion

This is all about the easiest way to upgrade Rocky Linux 8 to Rocky Linux 9. Before upgrading the operating system, check your system’s compatibility or you may face unexpected errors during reboot. Moreover, run the commands correctly to install the latest repos of Rocky Linux 9.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.