3

Running the latest kernel CentOS7

I decided to start using the ML kernel for my kvm host for performance gains on my kvm guests. You can easily install the ML or the LT kernels easily on CentOS7 using the ELrepo.

kernel-MT – mainline stable kernel
kernel-LT – long term support kernel

Steps:

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum remove kernel-headers kernel-tools kernel-tools-libs

edit /etc/yum.repos.d/elrepo.repo and enable=1 the elrepo-kernel. change the ml to lt to install the long term support kernel.


yum install kernel-ml.x86_64 kernel-ml-devel.x86_64 kernel-ml-headers.x86_64 kernel-ml-tools.x86_64 kernel-ml-tools-libs.x86_64 kernel-ml-tools-libs-devel.x86_64

time to get grub settled
awk -F' '$1=="menuentry " {print $2}' /etc/grub2.cfg

it should list all the kernels in grub2.cfg. if the first one is the newest kernel installed


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

REBOOT and you will be running the latest kernel

3 Comments

  1. The awk script above did not work in my case. I used the following:
    sudo grep ^menuentry /etc/grub2.cfg |awk -F”‘” ‘$1==”menuentry ” {print $2}’

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.