Change default entry on GRUB menu

Published at 17 Mar 2025

By default, the first element in the GRUB menu will be selected after the seconds at GRUB_TIMEOUT has passed.

In order to change the default selection we need to modify the GRUB_DEFAULT property at /etc/default/grub.

All the entries at the GRUB menu are numbered starting from 0. So if our menu looks like the following:

Ubuntu
Advanced options for Ubuntu
Memory test (memtest86+64.efi)
Memory test (memtest86+64.efi, serial console)
UEFI Firmware Settings
Windows 10

If we want to make the Windows 10 entry the default one, we should set the value as 5.

sudo vi /etc/grub/default
GRUB_DEFAULT=5

Once you've made all the changes, you should apply them by running the following command.

sudo update-grub