Upgrade Rocky Linux 9 Kernel To The Latest Version

This guide will show you how to upgrade the Kernel version to the latest version on Rocky Linux 9. A kernel is the heart of the Linux operating system. With Linux Kernel, it is possible to interact with the physical hardware and run software applications. Now you can follow the steps below to start upgrading the kernel on Rocky Linux 9 by using the ELRepo which offers the latest kernel version.

A Comprehensive Guide To Upgrade Rocky Linux 9 Kernel To The Latest Version

To complete your upgrading kernel process, you can log in to your Rocky Linux as a non-root user with sudo privileges. To do this, you can check the Rocky Linux 9 Initial Server Setup.

Step 1 – Display Current Kernel Version on Rocky Linux 9

First, you need to check your current kernel version by using the following command:

uname -msr
Output
Linux 5.14.0-162.6.1.el9_1.0.1.x86_64 x86_64

Then, run the system update with the command below:

sudo dnf update -y

Step 2 – Install ELRepo on Rocky Linux 9

As we said, we want to use ELRepo which offers the latest kernel versions that are available in Kernel Website. So you need to add the ELRepo GPG key and install it on your server. To add the ELRepo GPG key, run the command below:

sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

Then, install it by using the following command:

sudo dnf install https://www.elrepo.org/elrepo-release-9.el9.elrepo.noarch.rpm

Step 3 – Display Available Kernel Versions on Rocky Linux 9

At this point, you can use the following command to list the available kernel versions on your server:

sudo dnf list available --disablerepo='*' --enablerepo=elrepo-kernel

In your output, you will see:

Display Available Kernel Versions on Rocky Linux 9

As you can see, the kernel mainline release which refers to the latest official version of the Linux kernel is version 6.7. And latest stable version is kernel 6.1.

Let’s see how you can install them.

Step 4 – Install Latest Kernel Version on Rocky Linux 9

At this point, you can simply install both mainline and stable releases on your server.

To install the latest Kernel mainline, you can run the command below:

sudo dnf --enablerepo=elrepo-kernel install kernel-ml

Example Output:

install the latest Kernel mainline on Rocky Linux 9

To install the latest Kernel stable release, you can run the following command:

sudo dnf --enablerepo=elrepo-kernel install kernel-lt

Example Output:

install the latest Kernel stable release

Once your installation is completed, reboot your Rocky Linux 9:

sudo reboot

You’ll be presented with the GRUB or boot menu. Use the arrow keys to select the Linux kernel you have just installed, then press Enter. Your operating system should boot normally.

Check your Kernel version:

uname -msr
Output
Linux 6.1.74-1.el9.elrepo.x86_64 x86_64

Step 5 – Set the Default Kernel Version to the Latest on Rocky Linux 9

At this point, you can set your default kernel version to the latest version. It means that once you boot your system, it loads the latest kernel version by default. To do this, open the /etc/default/grub file with your desired text editor like Vi editor or Nano Editor:

sudo vi /etc/default/grub

At the file, look for the GRUB_DEFAULT=X line. Then, change it to GRUB_DEFAULT=0. It will configure the boot loader to default to the first kernel on the list, which is the latest.

Set the Default Kernel Version to the Latest on Rocky Linux 9

When you are done, save and close the file.

Next, you need to recreate the kernel configuration with the command below:

sudo grub2-mkconfig -o /boot/grub2/grub.cfg
recreate the kernel configuration

Finally, reboot your server again and verify your kernel version:

# sudo reboot
# uname -msr
Output
Linux 6.7.1-1.el9.elrepo.x86_64 x86_64

As you can see, it loads the latest kernel mainline release.

Conclusion

Upgrading the kernel ensures that your system benefits from the latest enhancements, bug fixes, and security patches, which are essential for the efficient and secure operation of your server or workstation. As you saw, you can easily use the ELRepo to get the latest Kernel version on Rocky Linux 9.

Hope you enjoy it. Also, you may like to read the following articles:

Upgrade Debian Kernel Without Network Connection

Check Installed Linux Kernel in Command Line

Upgrade Linux Kernel on AlmaLinux 9

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles

POPULAR TAGS

Most Popular