How to change default kernel in grub

I'm running Debian Jessie with kernel version 4.5.
Today I just install an older 3.18 kernel but I couldn't make it default.
When I look at the /boot/grub/grub.cfg I can see that it is located under  
Debian GNU/Linux menu as a submenu of named
    Debian GNU/Linux, with Linux 3.18.25.jessiemptcp.
I know that there is a configuration option named GRUB_DEFAULT=0 in /etc/default/grub.
What is the correct format or number to change default kernel as a submenu entry?

Solution:


You can use > character and numbers to select a submenu entry as default.
0 refers to first menu entry in grub. If parent of subentries starts from index 1 and you want to boot from third submenu entry as default (so that index number is 2), you need to change GRUB_DEFAULT variable as below:

GRUB_DEFAULT="1>2"
Please note that, there are no space characters before or after >
But, it is hard to describe submenu entry selection with numbers. There is another way, you can also use menu names like below:

GRUB_DEFAULT="Advanced options for Debian GNU/Linux>Debian GNU/Linux, with Linux 3.18.25.jessiemptcp"

After that, you need to run sudo update-grub command as well.
😊😊😊😊

Comments

Popular posts from this blog

How to cut copy and paste files on Mac

How To Install Latest Nodejs and React js on CentOS/RHEL 7/6

How to Scrap Email in Primary Level