How to install or upgrade to Kernel 5.0 in CentOS 7

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