How to install or upgrade to Kernel 5.0 in CentOS 7

Note – CentOS 7 will reach its End of Life (EOL) on June 30, 2024.

First check the current kernel version using the following command.

uname -sr

Output:

 3.10.0-957.el7.x86_64

Run the following commands to enable the ELRepo.

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm 

Now install the latest kernel.

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

Output:

kernel-ml-5.4.2-1.el7.elrepo.x86_64.rpm                                                                             |  48 MB  00:00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
  Installing : kernel-ml-5.4.2-1.el7.elrepo.x86_64                                                                                     1/1

  Verifying  : kernel-ml-5.4.2-1.el7.elrepo.x86_64                                                                                     1/1

Installed:
  kernel-ml.x86_64 0:5.4.2-1.el7.elrepo

Complete!

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

After reboot, just check the kernel version.

uname -sr

Output:

Linux 5.4.2-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