Kernel is central component of an operating system that manages operations of computer and hardware. It basically manages operations of memory and CPU time. It is core component of an operating system. Kernel acts as a bridge between applications and data processing performed at hardware level using inter-process communication and system calls.
Step 1 – Find current kernel version
Use the uname
command to display the current version of kernel the system is running.:
uname -sr
Output:
[root@vps ~]# uname -sr
Linux 4.18.0-372.13.1.el8_6.x86_64
Step 2 – Enable ELRepo
Import the public key and install the ELRepo RPM package using the below command.
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
dnf install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm
Output:
[root@vps ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
[root@vps ~]# dnf install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm
Last metadata expiration check: 0:00:01 ago on Mon 02 Jan 2023 06:30:20 PM UTC.
elrepo-release-8.el8.elrepo.noarch.rpm 89 kB/s | 13 kB 00:00
Dependencies resolved.
=============================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================
Upgrading:
elrepo-release noarch 8.3-1.el8.elrepo @commandline 13 k
Transaction Summary
=============================================================================================================================
Upgrade 1 Package
Total size: 13 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
Upgrading : elrepo-release-8.3-1.el8.elrepo.noarch 1/2
Cleanup : elrepo-release-8.0-2.el8.elrepo.noarch 2/2
Verifying : elrepo-release-8.3-1.el8.elrepo.noarch 1/2
Verifying : elrepo-release-8.0-2.el8.elrepo.noarch 2/2
Upgraded:
elrepo-release-8.3-1.el8.elrepo.noarch
Complete!
Once the repository has been enabled, you can use the following command to list the available kernel related packages:
dnf --disablerepo="*" --enablerepo="elrepo-kernel" list available
Output:
[root@vps ~]# dnf --disablerepo="*" --enablerepo="elrepo-kernel" list available
ELRepo.org Community Enterprise Linux Kernel Repository - el8 1.3 MB/s | 2.1 MB 00:01
Last metadata expiration check: 0:00:01 ago on Mon 02 Jan 2023 06:35:11 PM UTC.
Available Packages
bpftool.x86_64 6.1.2-1.el8.elrepo elrepo-kernel
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
kernel-ml.x86_64 6.1.2-1.el8.elrepo elrepo-kernel
kernel-ml-core.x86_64 6.1.2-1.el8.elrepo elrepo-kernel
kernel-ml-devel.x86_64 6.1.2-1.el8.elrepo elrepo-kernel
kernel-ml-doc.noarch 6.1.2-1.el8.elrepo elrepo-kernel
kernel-ml-headers.x86_64 6.1.2-1.el8.elrepo elrepo-kernel
kernel-ml-modules.x86_64 6.1.2-1.el8.elrepo elrepo-kernel
kernel-ml-modules-extra.x86_64 6.1.2-1.el8.elrepo elrepo-kernel
kernel-ml-tools.x86_64 6.1.2-1.el8.elrepo elrepo-kernel
kernel-ml-tools-libs.x86_64 6.1.2-1.el8.elrepo elrepo-kernel
kernel-ml-tools-libs-devel.x86_64 6.1.2-1.el8.elrepo elrepo-kernel
perf.x86_64 6.1.2-1.el8.elrepo elrepo-kernel
python3-perf.x86_64 6.1.2-1.el8.elrepo elrepo-kernel
Step 3 – Install kernel
Run the following command to install the latest mainline stable kernel:
dnf --enablerepo=elrepo-kernel install kernel-ml
output:
[root@vps ~]# dnf --enablerepo=elrepo-kernel install kernel-ml
Last metadata expiration check: 0:02:16 ago on Mon 02 Jan 2023 06:35:11 PM UTC.
Dependencies resolved.
=============================================================================================================================
Package Architecture Version Repository Size
=============================================================================================================================
Installing:
kernel-ml x86_64 6.1.2-1.el8.elrepo elrepo-kernel 98 k
Installing dependencies:
kernel-ml-core x86_64 6.1.2-1.el8.elrepo elrepo-kernel 34 M
kernel-ml-modules x86_64 6.1.2-1.el8.elrepo elrepo-kernel 30 M
Transaction Summary
=============================================================================================================================
Install 3 Packages
Total download size: 64 M
Installed size: 100 M
Is this ok [y/N]: y
Downloading Packages:
(1/3): kernel-ml-6.1.2-1.el8.elrepo.x86_64.rpm 140 kB/s | 98 kB 00:00
(2/3): kernel-ml-modules-6.1.2-1.el8.elrepo.x86_64.rpm 10 MB/s | 30 MB 00:02
(3/3): kernel-ml-core-6.1.2-1.el8.elrepo.x86_64.rpm 10 MB/s | 34 MB 00:03
-----------------------------------------------------------------------------------------------------------------------------
Total 19 MB/s | 64 MB 00:03
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
Preparing : 1/1
Installing : kernel-ml-core-6.1.2-1.el8.elrepo.x86_64 1/3
Running scriptlet: kernel-ml-core-6.1.2-1.el8.elrepo.x86_64 1/3
Installing : kernel-ml-modules-6.1.2-1.el8.elrepo.x86_64 2/3
Running scriptlet: kernel-ml-modules-6.1.2-1.el8.elrepo.x86_64 2/3
Installing : kernel-ml-6.1.2-1.el8.elrepo.x86_64 3/3
Running scriptlet: kernel-ml-core-6.1.2-1.el8.elrepo.x86_64 3/3
Running scriptlet: kernel-ml-6.1.2-1.el8.elrepo.x86_64 3/3
Verifying : kernel-ml-6.1.2-1.el8.elrepo.x86_64 1/3
Verifying : kernel-ml-core-6.1.2-1.el8.elrepo.x86_64 2/3
Verifying : kernel-ml-modules-6.1.2-1.el8.elrepo.x86_64 3/3
Installed:
kernel-ml-6.1.2-1.el8.elrepo.x86_64 kernel-ml-core-6.1.2-1.el8.elrepo.x86_64 kernel-ml-modules-6.1.2-1.el8.elrepo.x86_64
Complete!
Step 4 – Verify the kernel version
By default, the system will set the newly installed kernel as the default version to use and boot with.
You can verify this by running the below command,
grubby --default-kernel
Once confirmed, reboot the system to boot with the latest kernel installed. This can be further verified by running the uname
command,
uname -sr
output:
[root@vps ~]# uname -sr
Linux 6.1.2-1.el8.elrepo.x86_64
[root@vps ~]#