To make GRUB boot the last manually selected entry while still showing the countdown menu, edit /etc/default/grub:

GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=30

Then regenerate the config:

sudo update-grub

Before updating, it can be useful to back up the current generated config:

sudo cp /boot/grub/grub.cfg /boot/grub/grub.cfg.backup

Afterwards, verify the important changes:

sudo diff /boot/grub/grub.cfg /boot/grub/grub.cfg.backup

You should see GRUB switch from a fixed default:

set default="0"

to:

set default="${saved_entry}"

and savedefault should appear in the generated menu entries.

The result:

  • GRUB shows the menu with the configured countdown.
  • The last manually selected entry becomes the default.
  • If no key is pressed, GRUB boots that saved entry automatically.

You can inspect the currently saved entry with:

sudo grub-editenv list