How to Install Kernel 5.x on CentOS 7

Run the following commands to Add the ELRepo.

yum -y install https://www.elrepo.org/elrepo-release-7.0-4.el7.elrepo.noarch.rpm

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

Once the repository has been enabled, you can use the following command to list the available kernel related packages.

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

Output:

[root@vps ~]# yum --disablerepo="*" --enablerepo="elrepo-kernel" list available | grep kernel-ml
kernel-ml.x86_64                        5.6.14-1.el7.elrepo        elrepo-kernel
kernel-ml-devel.x86_64                  5.6.14-1.el7.elrepo        elrepo-kernel
kernel-ml-doc.noarch                    5.6.14-1.el7.elrepo        elrepo-kernel
kernel-ml-headers.x86_64                5.6.14-1.el7.elrepo        elrepo-kernel
kernel-ml-tools.x86_64                  5.6.14-1.el7.elrepo        elrepo-kernel
kernel-ml-tools-libs.x86_64             5.6.14-1.el7.elrepo        elrepo-kernel
kernel-ml-tools-libs-devel.x86_64       5.6.14-1.el7.elrepo        elrepo-kernel

Now install latest kernel.

yum --enablerepo=elrepo-kernel install kernel-ml

Output:

[root@vps ~]# yum --enablerepo=elrepo-kernel install kernel-ml
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirror.hostduplex.com
 * elrepo: repos.lax-noc.com
 * elrepo-kernel: repos.lax-noc.com
 * extras: mirror.rackspace.com
 * updates: mirrors.sonic.net
base                                                     | 3.6 kB     00:00
elrepo                                                   | 2.9 kB     00:00
extras                                                   | 2.9 kB     00:00
updates                                                  | 2.9 kB     00:00

Install kernel-ml-devel kernel-ml-headers kernel-ml-tools perf.

yum -y --enablerepo=elrepo-kernel install kernel-ml-{devel,headers,perf}

Output:

[root@vps ~]# yum -y --enablerepo=elrepo-kernel install kernel-ml-{devel,headers,perf}
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: centos-distro.1gservers.com
 * elrepo: repos.lax-noc.com
 * elrepo-kernel: repos.lax-noc.com
 * extras: mirror.rackspace.com
 * updates: mirrors.sonic.net
No package kernel-ml-perf available.
Resolving Dependencies
--> Running transaction check

Once you install the latest kernel, you will have to reboot the server.

reboot

Select Kernel 5.x in the Grub menu to boot to newly installed Kernel 5.x on CentOS 7.

kernel

To check the kernel version.

uname -r

Output:

[root@vps ~]# uname -r
5.6.14-1.el7.elrepo.x86_64

CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS