Change default kernel boot Centos 7

Posted 05 December, 2018

I installed a new kernel (kernel-ml, from mainline 4.18) to make sure on next boot it got selected this is what I had to do : (Since its headless and I won’t see grub when it boots)

Install kernel mainline :

yum install kernel-ml

Find the current installed kernels :

cat /boot/grub2/grub.cfg | grep ^menuentry | cut -c1-50 | nl -v 0

for me :

0  menuentry 'CentOS Linux (4.18.16-1.el7.elrepo.x86_
1  menuentry 'CentOS Linux (3.10.0-693.5.2.el7.x86_64
2  menuentry 'CentOS Linux (0-rescue-daa04fd470a24a8f

So I want the first kernel (starting from 0) as default; This can be added in /etc/default/grub :

GRUB_DEFAULT=0

Then remake grub config :

grub2-mkconfig -o /boot/grub2/grub.cfg

Reboot and the new kernel is :

[[email protected] ~]# uname -a
Linux svennd.local 4.18.16-1.el7.elrepo.x86_64 #1 SMP Sat Oct 20 12:52:50 EDT 2018 x86_64 x86_64 x86_64 GNU/Linux

 

 

If you enjoyed this article, please consider buying me a Dr Pepper.
Fuel the beast!

Buy me a Dr PepperBuy me a Dr Pepper



Show Comments (0)
© SvennD