How to upgrade Linux Kernel on Rocky Linux/AlmaLinux/CentOS 8

In this guide I will show you how to upgrade our Linux Kernel to the latest version on our Rocky Linux/ AlmaLinux and CentOS.

Linux Kernel is a free and open source, monolithic, modular, multitasking unix-like operating system. It is the main component of a Linux operating system and is the core interface between the computer’s hardware and its processes. It makes communication possible between computer hardware and processes running on it and it manages resources effectively.

Related Articles

How to upgrade Linux Kernel 5.13 to 5.15 on Ubuntu 21.10


  1. Rocky Linux server/AlmaLinux
  2. User with sudo privileges
  3. Strong internet connection

Table of Contents

  1. Update the operating system repositories
  2. Check current installed Linux Kernel
  3. Import ElRepo GPG key
  4. Install ElRepo repository for Rocky Linux
  5. Install latest Linux Kernel

1. Pass Updates on Rocky Linux/AlmaLinux

To begin our installation process, we need to update our repositories to reflect the new state of our operating system. We can do the update by issuing the following command on our terminal.

$ sudo dnf update -y

When the update is complete, we can then check our current Linux Kernel to know where we are starting from.

2. Check current installed Linux Kernel

To check the current running Linux Kernel in our system we can pass the following command in our terminal. It will show us the current installed Linux Kernel.

$ uname -r

You out should look like this

# uname -r

Now that we have seen the current installed Linux Kernel, let’s now begin the installation process but first we need to add the GPG key to our repository.

3. Import ELRepo GPG Key

The ELRepo project uses a GPG key to sign all RPM packages that is released. Each ELRepo project is sign with a GPG signature. To ensure autenticity of the signature you must verify it before installation. It must match with the following fingerprint.

# Fingerprint: 96C0 104F 6315 4731 1E0B B1AE 309B C305 BAAD AE52

To verify your fingerprint you can use the following command on our terminal.

$ gpg --quiet --with-fingerprint

If you have a matching key with the fingerprint then you can now import it. Use the below command to do the import.

$ sudo rpm --import

Next we can install ELRepo in our repository.

4. Install ELRepo repository on Rocky Linux

If your import was successful, you can now move ahead and install it in your system with the following command.

$ sudo dnf install

Press Y to allow installation to continue. The output you will get will be as follows


# sudo dnf install
DigitalOcean Droplet Agent                                                        43 kB/s | 3.3 kB     00:00    
elrepo-release-8.el8.elrepo.noarch.rpm                                            52 kB/s |  13 kB     00:00    
Dependencies resolved.
 Package                     Architecture        Version                         Repository                 Size
 elrepo-release              noarch              8.2-1.el8.elrepo                @commandline               13 k

Transaction Summary
Install  1 Package

Total size: 13 k
Installed size: 5.0 k
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                         1/1 
  Installing       : elrepo-release-8.2-1.el8.elrepo.noarch                                                  1/1 
  Verifying        : elrepo-release-8.2-1.el8.elrepo.noarch                                                  1/1 



When all the prerequisites had been meet we can now install the latest kernel which is Linux Kernel 5.15 as of this writing.

5. Install latest Linux Kernel

We are going to install the mainline version because that is always the latest release by the Kernel maintainers. You can use the following command.

$ sudo dnf --enablerepo=elrepo-kernel install kernel-ml kernel-ml-devel kernel-ml-headers

After the installation is complete you must reboot the system for the new changes to take effect.

$ sudo systemctl reboot 

Check again to see if the changes have been effected.

$ uname -r

You will see the following output

# uname -r

Hurray! we have successfully upgrade to Linux Kernel 5.15.2.


Congratulations! You have learn how to upgrade Linux Kernel to the latest release on Rocky Linux. To learn more please consult the documentation.

About Kipkoech Sang

I am a technology enthusiast who loves to share gained knowledge through offering daily tips as a way of empowering others. I am fan of Linux and all other things open source.
View all posts by Kipkoech Sang →

Leave a Reply

Your email address will not be published.