CentOS 8 operation comes with a custom kernel to ensure its integrity and compatibility with supported hardware. The kernel version included in CentOS 8 Linux is 4.18. The Linux kernel includes the basic kernel itself and many kernel modules.
The Linux kernel is the main component of the Linux operating system (OS) and the core interface between computer hardware and its processes. It has the following main functions:
If you are a novice and want to install the latest version of the Linux kernel, then this guide is for you. The list of kernel-related packages available for CentOS is as follows:
The general standard method for installing the latest kernel on CentOS is to build from source code. In this article, I will introduce you to ELRepo that provides RPM packages.
ELRepo is an RPM repository for Enterprise Linux software packages. It supports Red Hat Enterprise Linux (RHEL) and its derivative versions, such as Scientific Linux, CentOS, etc.
Test environment: Hui hosting www.idccoupon.com website.
Test system: CentOS 8 system.
Test purpose: install Kernel 5.x kernel version
Add the ELRepo repository to the CentOS 8 system by running the following command.
sudo dnf -y install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm
The installer will create a repository file in the /etc/yum.repos.d directory.
$ cat /etc/yum.repos.d/elrepo.repo
After adding the repository to the system, you can import the public key:
sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
The repository added here has an elrepo-kernel channel, which provides a long-term (kernel-lt) support kernel and the latest stable mainline kernel (kernel-ml) for CentOS and RHEL Linux systems .
We can list the mainline kernel versions available in the resource library:
$ sudo dnf --disablerepo="*"--enablerepo="elrepo-kernel" list available | grep kernel-ml
kernel-ml.x86_64 5.7.4-1.el8.elrepo elrepo-kernel
kernel-ml-core.x86_64 5.7.4-1.el8.elrepo elrepo-kernel
kernel-ml-devel.x86_64 5.7.4-1.el8.elrepo elrepo-kernel
kernel-ml-doc.noarch 5.7.4-1.el8.elrepo elrepo-kernel
kernel-ml-headers.x86_64 5.7.4-1.el8.elrepo elrepo-kernel
kernel-ml-modules.x86_64 5.7.4-1.el8.elrepo elrepo-kernel
kernel-ml-modules-extra.x86_64 5.7.4-1.el8.elrepo elrepo-kernel
kernel-ml-tools.x86_64 5.7.4-1.el8.elrepo elrepo-kernel
kernel-ml-tools-libs.x86_64 5.7.4-1.el8.elrepo elrepo-kernel
kernel-ml-tools-libs-devel.x86_64 5.7.4-1.el8.elrepo elrepo-kernel
This will install the Linux kernel module as a dependency.
Dependencies resolved.========================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================
Installing:
kernel-ml x86_64 5.7.4-1.el8.elrepo elrepo-kernel 32 k
Installing dependencies:
kernel-ml-modules x86_64 5.7.4-1.el8.elrepo elrepo-kernel 23 M
kernel-ml-core x86_64 5.7.4-1.el8.elrepo elrepo-kernel 28 M
Transaction Summary
========================================================================================================================================================
Install 3 Packages
Total download size:51 M
Installed size:87 M
Is this ok [y/N]: y
Now that the availability of Linux Kernel 5.x has been confirmed, you can continue to install it.
sudo dnf --enablerepo=elrepo-kernel install kernel-ml
Install other kernel packages
sudo dnf --enablerepo=elrepo-kernel install kernel-ml-{devel,headers}
After installing Linux Kernel 5.4 on CentOS 8, you need to reboot the system.
sudo reboot
Select kernel 5.x in the grub menu.
After the operating system starts, run the uname command to confirm the kernel version that the operating system is running.
$ uname -a
Linux cent01 5.7.4-1.el8.elrepo.x86_64 #1 SMP Thu Jun 1810:07:20 EDT 2020 x86_64 x86_64 x86_64 GNU/Linux
Of course, you may need to take further steps to confirm that all OS functions are operating as expected.
You can use the dnf command to remove Linux Kernel5.x from a CentOS 8 computer at any time.
First boot to the default operating system version of the Linux kernel.
Confirm the currently installed kernel.
$ uname -r
4.18.0- 80. el8.x86_64
Then delete the installed Kernel5.x from ELRepo.
sudo dnf remove kernel-ml kernel-ml-{devel,headers}
Confirm removal.
Dependencies resolved.========================================================================================================================================================
Package Arch Version Repository Size
========================================================================================================================================================
Removing:
kernel-ml x86_64 5.7.4-1.el8.elrepo @elrepo-kernel 0
kernel-ml-devel x86_64 5.7.4-1.el8.elrepo @elrepo-kernel 50 M
kernel-ml-headers x86_64 5.7.4-1.el8.elrepo @elrepo-kernel 5.0 M
Removing unused dependencies:
kernel-ml-core x86_64 5.7.4-1.el8.elrepo @elrepo-kernel 64 M
kernel-ml-modules x86_64 5.7.4-1.el8.elrepo @elrepo-kernel 23 M
perl-Carp noarch 1.42-396.el8 @BaseOS 41 k
perl-Errno x86_64 1.28-416.el8 @BaseOS 9.3 k
perl-Exporter noarch 5.72-396.el8 @BaseOS 54 k
perl-File-Path noarch 2.15-2.el8 @BaseOS 63 k
perl-IO x86_64 1.38-416.el8 @BaseOS 137 k
perl-PathTools x86_64 3.74-1.el8 @BaseOS 179 k
perl-Scalar-List-Utils x86_64 3:1.49-2.el8 @BaseOS 122 k
perl-Socket x86_64 4:2.027-3.el8 @BaseOS 124 k
perl-Text-Tabs+Wrap noarch 2013.0523-395.el8 @BaseOS 24 k
perl-Unicode-Normalize x86_64 1.25-396.el8 @BaseOS 623 k
perl-constant noarch 1.33-396.el8 @BaseOS 26 k
perl-interpreter x86_64 4:5.26.3-416.el8 @BaseOS 14 M
perl-libs x86_64 4:5.26.3-416.el8 @BaseOS 5.8 M
perl-macros x86_64 4:5.26.3-416.el8 @BaseOS 5.1 k
perl-parent noarch 1:0.237-1.el8 @BaseOS 9.0 k
perl-threads x86_64 1:2.21-2.el8 @BaseOS 107 k
perl-threads-shared x86_64 1.58-2.el8 @BaseOS 76 k
Transaction Summary
========================================================================================================================================================
Remove 22 Packages
Freed space:163 M
Is this ok [y/N]: y
Recommended Posts