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.
- Rocky Linux server/AlmaLinux
- User with sudo privileges
- Strong internet connection
Table of Contents
- Update the operating system repositories
- Check current installed Linux Kernel
- Import ElRepo GPG key
- Install ElRepo repository for Rocky Linux
- 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 4.18.0-305.3.1.el8_4.x86_64
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 RPM-GPG-KEY-elrepo.org
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 https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
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 https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm
Press Y to allow installation to continue. The output you will get will be as follows
# sudo dnf install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm 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 ================================================================================================================= Installing: 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 Installed: elrepo-release-8.2-1.el8.elrepo.noarch Complete!
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 5.15.2-1.el8.elrepo.x86_64
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.