Change default kernel on CentOS7

This is how to change the kernel in CentOS7

  1. Check kernel version

    uname -r
    
  2. Kernel install with yum package manager

    yum install yum-plugin-fastermirror - y
    rpm —import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
    # available kernel list
    yum list available --disablerepo='*' --enablerepo=elrepo-kernel
    # stable kernel
    yum --enablerepo=elrepo-kernel install kernel-lt -y
    # latest kernel
    yum --enablerepo=elrepo-kernel install kernel-ml -y
    
  3. Update grub

    # bootable installed kernel check
    awk -F\' '$1=="menuentry " {print $2}' /etc/grub2.cfg
       
    # First is 0, set the desired order
    grub2-set-default 3
    grub2-mkconfig -o /boot/grub2/grub.cfg
       
    # Check the currently set value
    grub2-editenv list
    
  4. Reboot

    reboot
    
Cybertramp avatar
Cybertramp
Frog in the well
comments powered by Disqus