How to Install Linux Kernel 6.4 on Rocky Linux

An operating system can be defined as software that supports the computer’s basic functions, such as scheduling tasks and controlling peripherals. Linux is one of the operating systems just like Windows and macOS.Its preference is all over the world and is popularly used on desktops, laptops, servers, Android systems etc. In other words, Linux is almost everywhere. In this guide, we will walk through how to install Linux Kernel 6.1 on Rocky Linux 8|Alma Linux 8|CentOS Stream 8.

The Kernel is the core of any operating system. It is used to link and manage the hardware and software components of a system. Though it is invisible to the user, it resides in its own space referred to as the “little world“. From its little world, the kernel is able to perform:

  • Device drivers management: act as mediator/interpreter between the hardware and processes
  • System calls and security: Receive requests for service from the processes
  • Process management: Determine which processes can use the central processing unit (CPU), when, and for how long
  • Memory management: Keep track of how much memory is used to store what, and where

Since the Linux Kernel is a code, it can be developed just like any other program. It’s versioning normally has 3 numbers. For example 5.18.5. All these numbers have meanings:

  • First number that represents the major version “5”
  • Second number is the series of minor updates “18”
  • Third number is the patch version “5”

During the versioning, too-long numbers such as Linux Kernel 5.20 are avoided. For such cases, they move to the major version, for example, Linux Kernel 6.0.

The default Linux Kernel version on Rocky Linux 8|Alma Linux 8|CentOS Stream 8 is 4.18. But if you are a bleeding edge person and would like to install the latest release of Linux kernel then this guide is for you. The Linux Kernel 6.1 is available for installation. It offers several features and benefits which include:

  • New Hardware support
  • New Wallpapers.
  • The latest version of LibreOffice
  • Inclusion of Rust code
  • Scheduler changes
  • Real-time Kernel building support
  • Improvements to various Filesystems
  • Cool System Monitoring Center tool that displays information about the CPU, RAM, GPU, Disk e.t.c
  • A series of assistive technology tools include the virtual keyboard tool OnBoard, the screen reader app Orca, and a desktop magnifying app.

Now let’s dive in!

NOTE: As of this article update Kernel 6.1 is an RC release, wait for an official stable release before using it in Production environments. This guide should only be applied in Dev / Test use cases.

Step 1 – Update system and reboot

Before we proceed, update your system and all the available packages to their latest stable versions:

sudo yum update -y

Once updated, reboot the system:

sudo reboot

Check the kernel version:

$ uname -r
4.18.0-425.3.1.el8.x86_64

Step 2 – Add ELRepo repository to the system

The ELRepo provides both the long-term(kernel-lt) support kernels and the latest stable mainline kernels(kernel-ml) for CentOS and RHEL Linux systems. This repository can be added to the system using the command:

sudo dnf -y install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm

This command will create a repo file under /etc/yum.repos.d. To view the file contents, issue the command:

cat /etc/yum.repos.d/elrepo.repo

Import the GPG Key for the repository:

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

Step 3 – Install Linux Kernel 6.1 packages

Once the repository has been added, you can install either the long-term(kernel-lt) support kernels or the latest stable mainline kernels(kernel-ml).

For this guide, we will install the Linux Kernel 6.1 which is still provided as the latest stable mainline kernel (kernel-ml).

To list the latest stable mainline releases, use the command:

sudo dnf --disablerepo="*" --enablerepo="elrepo-kernel" list available | grep kernel-ml

Sample Output:

kernel-ml.x86_64                        6.1.6-1.el8.elrepo         elrepo-kernel
kernel-ml-core.x86_64                   6.1.6-1.el8.elrepo         elrepo-kernel
kernel-ml-devel.x86_64                  6.1.6-1.el8.elrepo         elrepo-kernel
kernel-ml-doc.noarch                    6.1.6-1.el8.elrepo         elrepo-kernel
kernel-ml-headers.x86_64                6.1.6-1.el8.elrepo         elrepo-kernel
kernel-ml-modules.x86_64                6.1.6-1.el8.elrepo         elrepo-kernel
kernel-ml-modules-extra.x86_64          6.1.6-1.el8.elrepo         elrepo-kernel
kernel-ml-tools.x86_64                  6.1.6-1.el8.elrepo         elrepo-kernel
kernel-ml-tools-libs.x86_64             6.1.6-1.el8.elrepo         elrepo-kernel
kernel-ml-tools-libs-devel.x86_64       6.1.6-1.el8.elrepo         elrepo-kernel

To view long-term releases only, use the command:

$ sudo dnf --disablerepo="*" --enablerepo="elrepo-kernel" list available | grep kernel-lt
kernel-lt.x86_64                        5.4.228-1.el8.elrepo       elrepo-kernel
kernel-lt-core.x86_64                   5.4.228-1.el8.elrepo       elrepo-kernel
kernel-lt-devel.x86_64                  5.4.228-1.el8.elrepo       elrepo-kernel
kernel-lt-doc.noarch                    5.4.228-1.el8.elrepo       elrepo-kernel
kernel-lt-headers.x86_64                5.4.228-1.el8.elrepo       elrepo-kernel
kernel-lt-modules.x86_64                5.4.228-1.el8.elrepo       elrepo-kernel
kernel-lt-modules-extra.x86_64          5.4.228-1.el8.elrepo       elrepo-kernel
kernel-lt-tools.x86_64                  5.4.228-1.el8.elrepo       elrepo-kernel
kernel-lt-tools-libs.x86_64             5.4.228-1.el8.elrepo       elrepo-kernel
kernel-lt-tools-libs-devel.x86_64       5.4.228-1.el8.elrepo       elrepo-kernel

We have confirmed that Linux Kernel 6.0 is provided as the latest stable mainline. We can install it with the command:

# Install mainline kernels(#6.1)
sudo dnf --enablerepo=elrepo-kernel install kernel-ml
sudo dnf --enablerepo=elrepo-kernel install kernel-ml-{devel,headers}

Sample Output:

.....
Transaction Summary
==============================================================================================
Install  3 Packages

Total download size: 64 M
Installed size: 100 M
Is this ok [y/N]: y

If you want to install a long-term kernel, you can use the command:

##Install LTS kernels
sudo dnf --enablerepo=elrepo-kernel install kernel-lt
sudo dnf --enablerepo=elrepo-kernel install kernel-lt-{devel,headers}

Step 4 – Boot to Linux Kernel 6.1

Once the installation is complete, reboot the system.

sudo reboot

The system will boot into the Linux Kernel 6.0 automatically as shown.

Once the system boot is complete, check the available Kernel with the command:

$ uname -a
Linux localhost.localdomain 6.1.0-1.el8.elrepo.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Dec 11 18:20:33 EST 2022 x86_64 x86_64 x86_64 GNU/Linux

Now you can take any other actions to confirm that all OS functions are operational.

sudo yum install epel-release -y 
sudo yum install neofetch -y

Use neofetch to view the Kernel Version:

Step 5 – How To Uninstall Linux Kernel 6.1 (Reference only)

If you are not satisfied with the Linux Kernel 6.0 installation, you can easily remove it using the DNF command. But before you proceed, boot into the default Linux Kernel

Confirm that the Kernel is selected:

$ uname -r
4.18.0-425.3.1.el8.x86_64

Now remove the installed Kernel.

# For mainline kernels
sudo dnf remove kernel-ml kernel-ml-{devel,headers} -y 

##For LTS kernels
sudo dnf remove kernel-lt kernel-lt-{devel,headers} -y

Related Articles

Responses

Your email address will not be published. Required fields are marked *

Cancel reply

Exit mobile version