First, make a backup copy of /etc/default/grub
. If something goes wrong, you can easily revert to the known-good copy.
sudo cp /etc/default/grub /etc/default/grub.bak
Then edit the file using the text editor of your choice (e.g. gedit, etc.).
sudo -H gedit /etc/default/grub
Find the line that contains GRUB_DEFAULT
- this is what you'll want to edit to set the default. You must know the full name of the kernel you want - e.g. Ubuntu, with Linux 3.13.0-53-generic
- along with the full name of the "advanced menu" - e.g. Advanced options for Ubuntu
.
You then combine those two strings with >
and set GRUB_DEFAULT
to them as: GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux 3.13.0-53-generic"
(including quotes).
Save it, then build the updated grub menu.
sudo update-grub
See also: GNU GRUB Manual 2.02 or more specifically section 15.1.0 on setting the default.
Note: There is a method utilizing numbers to access kernels and menus but this is not recommended as it is unreliable when kernel updates occur.
Best Answer
gksudo gedit /etc/default/grub
press Enter and enter your password.You will see the following contents:
You can change the default from 0 to any number, corresponding to the entry in the Grub bootup menu (first entry is 0, second is 1, etc.)
GRUB_HIDDEN_TIMEOUT_QUIET=false
)GRUB_HIDDEN
lines with a#
at the beginning of the lineAnd set the grub menu timeout (default is 10 seconds)
Make your changes, press Ctrl + S to save and Ctrl + Q to exit
sudo update-grub
to apply the changes you just madeLinked Question: