Site icon CentLinux

How to upgrade Rocky Linux 8 to 9

Share on Social Media

Learn how to upgrade Rocky Linux 8 to 9 with our detailed step-by-step guide. Ensure a smooth and successful upgrade process for your Rocky Linux system today. #centlinux #linux #rockylinux

What is Rocky Linux?

Rocky Linux is a Linux distribution developed by Rocky Enterprise Software Foundation. It is intended to be a downstream, complete binary-compatible release using the Red Hat Enterprise Linux (RHEL) operating system source code. The project’s aim is to provide a community-supported, production-grade enterprise operating system. Rocky Linux, along with Red Hat Enterprise Linux and SUSE Linux Enterprise, has become popular for enterprise operating system use.

Rocky Linux 9.0, the latest version of the open source enterprise operating system designed to be fully bug-for-bug compatible with Red Hat Enterprise Linux (RHEL), is now generally available. The update includes new security and networking features, and a new open source build system called Peridot.

Released on 14 July 2022, Rocky Linux 9.0 has all of the build chain infrastructure tools for developers to pick up Rocky Linux or extend or reproduce the Operating system, should a developer want to do something independently of the community or any upstream supporting organization. A primary goal behind developing the new, cloud-native build system was assuring that new versions of Rocky can be released within one week of new RHEL version releases.

How to upgrade Rocky Linux 8 to 9

What’s new in Rocky Linux 9?

Some of the new features of Rocky Linux 9 are:

Recommended Training: The Linux Command Line Bootcamp: Beginner To Power User from Colt Steele

System Requirements

With Rocky Linux 9.0, some older CPUs will not work well, or perhaps at all. The following architectures are considered minimum requirements for a successful install:

Environment Specification

We are working with a minimal installation of Rocky Linux 8, specifically configured to provide a clean and lightweight environment for this tutorial. This setup ensures that the system is optimized for performance and offers the flexibility to customize as needed. Below are the specifications of the virtual machine being used:

This minimal configuration is ideal for testing and implementing system upgrades, ensuring we can focus on the essential steps without unnecessary overhead. If you are using a different setup, such as a graphical interface or additional pre-installed software, the commands may still apply but might require slight adjustments.

Updating Software Packages

To begin, use an SSH client such as PuTTY, OpenSSH, or any terminal application to establish a secure connection with your Rocky Linux server. Connect to the server by specifying its hostname, rockylinux-01.centlinux.com, and log in as the root user to gain administrative access.

Once connected, it’s essential to ensure that the system’s package manager is up-to-date. Rebuilding the cache of enabled YUM repositories will refresh the list of available packages and ensure you are working with the latest metadata. This step is crucial, especially when preparing for software installations, updates, or upgrades.

Execute the necessary command to rebuild the repository cache. This process will verify that the enabled repositories are accessible and synchronized with their respective package sources. Keeping the repository cache up-to-date ensures smoother and error-free package management on your Rocky Linux system.

# dnf makecache

Execute following dnf command to update software packages in your Rocky Linux server.

# dnf update -y

Gathering System Information

Here, you are going to upgrade Rocky Linux 8 to 9.

Therefore, it is good to note down the information about your existing system components before starting upgrade process.

Check versions of Linux operating system, Linux Kernel and other installed applications as follows.

# cat /etc/rocky-release
Rocky Linux release 8.6 (Green Obsidian)

# uname -r
4.18.0-372.16.1.el8_6.0.1.x86_64

# mysql -V
mysql  Ver 15.1 Distrib 10.3.32-MariaDB, for Linux (x86_64) using readline 5.1

# httpd -v
Server version: Apache/2.4.37 (rocky)
Server built:   Jun 22 2022 14:17:54

# php -v
PHP 7.2.24 (cli) (built: Oct 22 2019 08:28:36) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies

Upgrade Yum Repositories from Rocky Linux 8 to 9

For upgrading your yum repositories from Rocky Linux 8 to 9, you have to upgrade following three software packages.

  1. rocky-gpg-keys
  2. rocky-release
  3. rocky-repos

You can either download above software packages from Rocky Linux website.

Or you can execute following dnf command to install all three of them on your Linux operating system.

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

You can safely ignore the warning during the execution of above command.

How to upgrade Rocky Linux 8 to 9

With all the necessary preparations completed, you are now ready to seamlessly upgrade your Linux operating system to the latest version. Upgrading your system ensures access to the newest features, enhanced performance, improved security patches, and compatibility with the latest software packages.

Simply execute the following command at the Linux Bash prompt to initiate the upgrade process. This command will handle the downloading and installation of all updated packages and dependencies required for the upgrade. Ensure you have a stable internet connection, as this process will fetch necessary files from the online repositories.

Before proceeding, it’s always a good idea to double-check that you have a current backup of your important files and configurations, just as an added precaution. Once the command is executed, the upgrade process will guide you through any prompts or confirmations, ensuring a smooth transition to the updated version of your Linux operating system.

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

Above command takes a couple of minutes to complete and successfully upgrades your server operating system from Rocky Linux 8 to 9. It also upgrade software applications and Linux Kernel as well.

In Rocky Linux 9, the RPM backend database format has been changed from Berkley Database Backend to SQLite.

Therefore, you need to rebuild your RPM database once to upgrade it to SQLite backend.

# rpm --rebuilddb
warning: Converting database from bdb_ro to sqlite backend

Reboot your Linux operating system with the new Linux kernel.

# reboot

Verify Software Versions after Upgrade

During system boot, you may observe the Old Linux Kernel 4.18 is still listed in the GRUB boot menu.

It is the default behavior of Linux operating system to keep two previous Kernels for fallback support.

Although if you don’t like it there, you can remove it by following our guide on how to remove old Linux kernels.

Check versions of Linux operating system, Linux Kernel and installed applications as follows.

# cat /etc/rocky-release
Rocky Linux release 9.0 (Blue Onyx)

# uname -r
5.14.0-70.17.1.el9_0.x86_64

# mysql -V
mysql  Ver 15.1 Distrib 10.5.13-MariaDB, for Linux (x86_64) using  EditLine wrapper

# httpd -v
Server version: Apache/2.4.51 (Rocky Linux)
Server built:   Mar 21 2022 00:00:00

# php -v
PHP 8.0.13 (cli) (built: Nov 16 2021 18:07:21) ( NTS gcc x86_64 )
Copyright (c) The PHP Group
Zend Engine v4.0.13, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.13, Copyright (c), by Zend Technologies

You can see that your Linux operating system along with Linux Kernel and installed applications has been upgraded from Rocky Linux 8 to 9.

Final Thoughts

Upgrading from Rocky Linux 8 to Rocky Linux 9 is a straightforward process when done carefully. By following this guide, you can ensure a smooth transition to the latest version, taking advantage of enhanced features, improved security, and updated software packages. Always remember to back up your data and test the upgrade process in a staging environment before applying it to production systems. With proper preparation, you can enjoy the benefits of Rocky Linux 9 with minimal downtime and maximum efficiency. If you’d like a detailed walkthrough, check out our accompanying video tutorial to simplify the process further.

Optimize your cloud infrastructure and secure your servers with my AWS and Linux administration services. Let’s ensure your systems run smoothly. Connect with me on Fiverr now!

Exit mobile version