Learn how to upgrade Linux kernel in CentOS 8 to improve system performance, security, and hardware compatibility. Follow our step-by-step guide to install the latest stable kernel version safely. #centlinux #linux #linuxkernel
Table of Contents
What is Linux Kernel?
Kernel is the most important component of any Linux operating system. A Linux kernel is works as the interpreter or mediator between computer hardware and software processes.
The Linux Kernel performs following tasks.
- Process Management
- Memory Management
- Device Drivers
- System Calls and Security
Each Linux distribution is shipped with a stable version of Linux Kernel and the supported software and drivers. But the shipped Kernel may not be the the latest one.
One needs to upgrade the whole operating system to move to another major version of Linux Kernel.

But there are some methods by using them, you can upgrade your operating system to latest Linux kernel.
The Kernel source is provided by the The Linux Kernel Archives. Based on the available source code two editions of Linux has been compiled and distributed through ELRepo yum repository.
kernel-lt is compiled by using the source code in “longterm” branch, whereas kernel-ml is compiled by using the source code in “mainline” branch.
Read Also: Install Mainline Linux Kernel 6.0 on Rocky Linux 9
Recommended Training: The Linux Command Line Bootcamp: Beginner To Power User from Colt Steele

Linux Server Specification
We are using a minimal CentOS 8 KVM machine with following specification.
- CPU – 3.4 Ghz (2 cores)
- Memory – 2 GB
- Storage – 20 GB
- Operating System – CentOS 8.2
- Hostname – centos-8.centlinux.com
- IP Address – 192.168.116.206 /24
65W Surface Pro Laptop Charger for Microsoft Surface Pro 10, 9, 8, 7+, 7, 6, 5, 4, 3, X, Windows Surface Laptop 6, 5, 4, 3, 2, 1, Surface Go Tablet, Surface Book 3, 2, 1, Support 44W, 36W, LED, 10FT
$26.99 (as of May 18, 2025 16:20 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Update Linux Software Packages
Connect with centos-8.centlinux.com server as root user by using a SSH tool.
Upgrade existing software packages in CentOS 8 machine by using the dnf command.
dnf update -y
Verify the Kernel version of CentOS 8 operating system.
uname -r
Output:
4.18.0-193.6.3.el8_2.x86_64
Install ELRepo Yum Repository
The latest Linux kernels are available through ELRepo yum repository. Therefore, we are installing the ELRepo repository using following dnf command.
dnf install -y https://www.elrepo.org/elrepo-release-8.el8.elrepo.noarch.rpm
Import the GPG Key of ELRepo repository into the system.
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
Build cache for newly installed yum repositories.
dnf makecache
Output:
CentOS-8 - AppStream 5.6 kB/s | 4.3 kB 00:00
CentOS-8 - Base 10 kB/s | 3.9 kB 00:00
CentOS-8 - Extras 785 B/s | 1.5 kB 00:01
ELRepo.org Community Enterprise Linux Reposi 2.9 kB/s | 2.9 kB 00:01
Metadata cache created.
8BitDo Retro 87 Mechanical Keyboard with RGB Backlight, Bluetooth/2.4G/USB-C Hot Swappable Wireless Gaming Keyboard for Windows and Android – Xbox Edition (Officially Licensed)
$110.02 (as of May 18, 2025 16:20 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Install Latest Linux Kernel in CentOS 8
ELRepo repository contains elrepo-kernel channel that provides the Long Term Supported kernels (kernel-lt) and Main-Line Stable Kernels (kernel-ml) for Red Hat Enterprise Linux based distributions. Both of these Kernel packages are built from the sources available from The Linux Kernel Archives.
Currently, there isn’t any Long Term Supported kernel is available in this channel. But the Main-Line kernel based on latest stable release of Linux Kernel 5.7 is available.
Search the elrepo-kernel channel to list down the kernel-ml related packages.
dnf --disablerepo="*" --enablerepo="elrepo-kernel" list available | grep kernel-ml
Output:
kernel-ml.x86_64 5.7.7-1.el8.elrepo elrepo-kernel
kernel-ml-core.x86_64 5.7.7-1.el8.elrepo elrepo-kernel
kernel-ml-devel.x86_64 5.7.7-1.el8.elrepo elrepo-kernel
kernel-ml-doc.noarch 5.7.7-1.el8.elrepo elrepo-kernel
kernel-ml-headers.x86_64 5.7.7-1.el8.elrepo elrepo-kernel
kernel-ml-modules.x86_64 5.7.7-1.el8.elrepo elrepo-kernel
kernel-ml-modules-extra.x86_64 5.7.7-1.el8.elrepo elrepo-kernel
kernel-ml-tools.x86_64 5.7.7-1.el8.elrepo elrepo-kernel
kernel-ml-tools-libs.x86_64 5.7.7-1.el8.elrepo elrepo-kernel
kernel-ml-tools-libs-devel.x86_64 5.7.7-1.el8.elrepo elrepo-kernel
Install the kernel-ml package by using the following command. You can also install any other kernel-ml-* package according to your requirement.
dnf --enablerepo="elrepo-kernel" install -y kernel-ml
Linux Kernel 5.7 has been installed on our CentOS 8 server.
To load the new Linux kernel we need to restart the CentOS 8 machine.
systemctl reboot
After reboot, the newly installed Linux Kernel 5.7 has been added to the GRUB boot menu.

Do not confuse with the long list of kernels in following screenshot. It is because, we have experimented with the different versions of Linux kernels. In your case, there will be only two boot menu entries.
Start the CentOS 8 operating system with Linux Kernel 5.7.
After CentOS 8 startup, execute the following command at Linux CLI to verify the active Kernel version.
uname -r
Output:
5.7.7-1.el8.elrepo.x86_64
We have successfully upgrade Linux Kernel to latest version i.e. 5.7 on CentOS 8.
Uninstall Old Linux Kernel
Uninstall process of Linux Kernel 5.7 is very straight forward, But we have included it in this article for the sake of completeness.
Restart your CentOS 8 machine.
systemctl reboot
Start the Linux operating system with a previous version of Linux Kernel.

After successful startup, verify the active kernel version by executing the following command at Linux CLI.
uname -r
Output:
4.18.0-193.6.3.el8_2.x86_64
Our CentOS 8 operating system is now using our previous Linux kernel.
Use dnf command to uninstall Linux Kernel 5.7 as follows.
dnf remove -y kernel-ml
Restart the CentOS 8 machine again.
systemctl reboot

You can see that the Linux Kernel 5.7 has been removed from the GRUB boot menu. Linux Kernel 5.7 has been uninstalled now.
Site Reliability Engineering: How Google Runs Production Systems
$24.77 (as of May 18, 2025 16:20 GMT +00:00 – More infoProduct prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on [relevant Amazon Site(s), as applicable] at the time of purchase will apply to the purchase of this product.)Frequently Asked Questions (FAQs)
Why should I upgrade the Linux kernel in CentOS 8?
Upgrading the Linux kernel improves system security, stability, and hardware compatibility, ensuring better performance and protection against vulnerabilities.
What are the prerequisites for upgrading the Linux kernel?
Before upgrading, ensure you have root or sudo privileges, a backup of important data, and access to the ELRepo repository, which provides updated kernel packages.
Does upgrading the kernel affect existing applications?
In most cases, upgrading the kernel does not break applications, but it is recommended to check for compatibility issues, especially with custom drivers or third-party software.
How can I verify that the new kernel is installed successfully?
After rebooting, you can check the active kernel version using the command: uname -r
If the output matches the newly installed version, the upgrade was successful.
Can I roll back to the previous kernel if something goes wrong?
Yes, CentOS allows selecting an older kernel from the GRUB menu during boot. Keeping the previous kernel installed ensures a fallback option in case of any issues.
Conclusion – Upgrade Linux Kernel
Upgrading the Linux kernel in CentOS 8 is essential for enhancing system stability, security, and hardware support. By following the upgrade process, including enabling the ELRepo repository, installing the latest kernel version, and updating the GRUB bootloader, you can ensure a smooth transition to an improved kernel.
Always verify the upgrade by checking the kernel version and testing system functionality before removing older versions.
Whether you need cloud optimization, server management, or automation, I provide comprehensive AWS and Linux services. Hire me on Fiverr to elevate your systems.
Leave a Reply
You must be logged in to post a comment.