AlmaLinux needs no introduction as a free and open-source RHEL-based Linux operating system distribution. Its binary compatibility with RHEL (Red Hat Enterprise Linux) attributes it to a production-grade enterprise operating system with growing community support.
A Kernel is a lifeline between hardware and software interaction within a computer system. Since the Kernel code always resides in memory, its presence is critical in how these key operating system components communicate with one another.
This article is for the bleeding edge enthusiasts who want to install the latest Kernel version on their AlmaLinux 8 distribution.
Prerequisites
- Have root/sudoer user privileges on the AlmaLinux system you are using.
- Have some basic knowledge of using the Linux command-line environment.
Installing Kernel in AlmaLinux 8
First, make sure your system should be up-to-date for performance optimization.
$ sudo dnf update -y
Next, install ELRepo and import the GPG key on the AlmaLinux system for RPM support.
$ sudo dnf -y install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm $ sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
Our configured ELRepo repository is associated with the elrepo-kernel channel which provides kernel-ml and kernel-lt for long-term support and the latest stable mainline kernels respectively.
The command for listing available mainline kernel releases is as follows:
$ sudo dnf --disablerepo="*" --enablerepo="elrepo-kernel" list available | grep kernel-ml
The command for listing long-term kernel releases is as follows:
$ sudo dnf --disablerepo="*" --enablerepo="elrepo-kernel" list available | grep kernel-lt
We can now install the mainline (ml) and long-term (lt) kernel 5.x versions.
$ sudo dnf --enablerepo=elrepo-kernel install kernel-ml-{devel, headers} $ sudo dnf --enablerepo=elrepo-kernel install kernel-lt
After installation, reboot your AlmaLinux system.
$ sudo reboot
After a successful system reboot, from the Grub menu, you should be able to use either of the ELRepo-installed kernels (kernel-ml version 5.18 or kernel-lt version 5.4) to boot into your AlmaLinux system.
For instance, we can go with the first selected option and confirm its viability from the AlmaLinux system terminal.
$ uname -r
We have successfully learned how to install the Linux kernel in AlmaLinux.