In Ubuntu Linux distro, GRUB menu is not enabled by default, which is annoying when we need to boot into a different version of kernel. This article will show you how to enable GRUB menu and set default kernel for booting.

To enable GRUB menu, edit /etc/default/grub file.

$ sudo vim /etc/default/grub
[inside editor]
...
GRUB_TIMEOUT_STYLE=menu  # change from hidden to menu
GRUB_TIMEOUT=5  # change from 0 to any duration you want
...
[save and exit]
$ sudo update-grub

At this point, GRUB menu has been enabled. Now, we may want to set the default boot entry to a specific version of kernel. Before we modify the configuration file, we need to gather some information from /boot/grub/grub.cfg file. Say, we want to set the kernel of version 5.4.0-147-generic as default boot entry, and it's under the advanced option menu. Then, the first thing we need to look for is the full name for the kernel, which should be Ubuntu, with Linux 5.4.0-147-generic. The second thing is that we need to look for the the menu name, which should be Advanced options for Ubuntu. We put both of them into the /etc/default/grub file with > connecting menu name and kernel name.

[inside editor]
...
GRUB_DEFAULT='Advanced options for Ubuntu>Ubuntu, with Linux 5.4.0-147-generic'
...
[save and exit]
$ sudo update-grub

At this point, we have GRUB menu enabled and cursor will be automatically stopped on the default booting entry we set just now.