Linux kernel is the foundation of the Linux computer operating system. A kernel is the lowest level of software that can interface with computer hardware. All Linux applications and servers also interface with the Linux kernel. All Linux distributions are based on the Linux kernel and use its services to implement various software functions.

The Linux kernel manages OS resources, making sure there is enough memory available for applications to run, optimizing processor usage, and avoiding system deadlocks caused by competing application demands.

install-latest-kernel-on-centos
Install latest kernel

With more than 23 million lines of code, the Linux kernel is one of the largest open source software projects in the world. Each version of the kernel is supported for up to six years. The Linux kernel is released under the GNU General Public License version 2 (GPLv2).

ReleaseRelease DateEnd of life
5.15 (LTS)31 Oct 202131 Oct 2023
5.10 LTS13 Dec 202001 Dec 2026
5.4 (LTS)24 Nov 201901 Dec 2025
EOL of Linux Kernel

Always try to upgrade the centos kernel whenever the new kernel updates are available, to keep the servers up to date. Updated versions of the Linux kernel can improve security, add functionality, and improve the speed at which the operating system functions.

Steps to Install latest Kernel on CentOS Linux

Installation of latest Kernel in CentOS Linux is easy and fairly straightforward. This guide will instruct you on how to install latest long-term support Linux kernel on CentOS.

Caution:

Installation of kernel on CentOS went smoothly in our case, However, we cannot guarantee that the same will be replicated in your case.

Prerequisites:

  • sudo privileges.
  • Stable internet connection.

Check Current Kernel Version.

# uname -r

Enable the EL Repo Repository.

To install kernel version, a new repository (EL Repo repository) needs to be enabled. Please run below commands to enable repo:

CentOS 7
# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
# yum -y install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm

CentOS 8
# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
# dnf -y install https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm

List Available Kernels

Note: In the list, kernel-lt means signifying a stable long-term support release and kernel-ml means which indicates a mainline release, with a shorter support term but with more frequent updates.

Please run below commands to list of available kernels:

# yum --disablerepo="*" --enablerepo="elrepo-kernel" list available

Now install Kernel Version
To install latest kernel version run bellow command:

CentOS 7
To install latest long-term support kernel (Recommended)
# yum -y --enablerepo=elrepo-kernel install kernel-lt

To install the latest mainline kernel
# yum -y --enablerepo=elrepo-kernel install kernel-ml

CentOS 8
To install latest mainline kernel:
# dnf -y -enablerepo=elrepo-kernel install kernel-ml

To install the latest long-term support kernel:
# dnf -y --enablerepo=elrepo-kernel install kernel-lt

Configure the default kernel

Set installed latest kernel as a default Kernel

# grub2-set-default 0
# grub2-mkconfig -o /boot/grub2/grub.cfg
# reboot

Now check latest Kernel Version after reboot

# uname -r

Remove an Old Kernel (Optional)
This is an optional step that is useful to get more free space on the server.

# yum install yum-utils
# package-cleanup --oldkernels

Congratulations! We’ve installed latest long-term support Kernel on CentOS Linux! We hope you found this 2 minutes stuff useful and thank you for visiting our website.
Cheers!!!