Skip to content

Latest commit

 

History

History
35 lines (27 loc) · 858 Bytes

grub-defaults.md

File metadata and controls

35 lines (27 loc) · 858 Bytes

Start by doing:

sudo vim /etc/default/grub

Then if you want to select item 2 of submenu 1 (both 0-indexed), set:

GRUB_DEFAULT="1>2"

(The default here is GRUB_DEFAULT=0 if you need to revert back)

Typically submenu 1 gets you into Advanced options for Ubuntu, then the 2nd or 4th item is your custom kernel, since kernels are listed something like this:

- 0: Default kernel 1 (e.g. `5.15.0-97-generic`)
- 1: Recovery Mode Default kernel 1 (e.g. `5.15.0-97-generic`)
- 2: Default kernel 2 (e.g. `5.15.0-94-generic`)
- 3: Recovery Mode Default kernel 2 (e.g. `5.15.0-94-generic`)
- 4: Custom kernel (e.g. `5.15.0+`)
- 5: Recovery Mode Custom kernel (e.g. `5.15.0+`)

Also, if you want to make sure the grub menu displays, set:

# GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=20

Finally, run:

sudo update-grub