Changing the kernel chosen by GRUB

31 Dec

Determine the options (both main and sub menu):

awk 'BEGIN {submenu=0;menu=0};$1 ~ /submenu/ {submenu+=1;menu=0;sub(/\$.*$/,"");print submenu" " $0};/menuentry / && /Linux/ {gsub(/menuentry/,"");gsub(/--class.*$/,"");gsub(/\047/,"");print "  "submenu">"menu " " $0;menu+=1}' /boot/grub/grub.cfg

Change the default to the desired option:

nano /etc/default/grub

Where X>X is the menu item (0 is the top)
This must be in quotes!

Save your new configuration:

update-grub

6 thoughts on “Changing the kernel chosen by GRUB

  1. You’re so awesome! I don’t believe I have read a single thing like that before. So great to find someone with some original thoughts on this topic. Really.. thank you for starting this up. This website is something that is needed on the internet, someone with a little originality!

Leave a Reply

Your email address will not be published.