$ grep menuentry /boot/grub/grub.cfg
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
menuentry_id_option=""
export menuentry_id_option
menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-c06f67d0-65bb-4544-8d46-12a37489d4cd' {
submenu 'Advanced options for Ubuntu' $menuentry_id_option 'gnulinux-advanced-c06f67d0-65bb-4544-8d46-12a37489d4cd' {
menuentry 'Ubuntu, with Linux 4.15.0-55-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-55-generic-advanced-c06f67d0-65bb-4544-8d46-12a37489d4cd' {
menuentry 'Ubuntu, with Linux 4.15.0-55-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-55-generic-init-upstart-c06f67d0-65bb-4544-8d46-12a37489d4cd' {
menuentry 'Ubuntu, with Linux 4.15.0-55-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-55-generic-recovery-c06f67d0-65bb-4544-8d46-12a37489d4cd' {
menuentry 'Ubuntu, with Linux 4.15.0-54-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-54-generic-advanced-c06f67d0-65bb-4544-8d46-12a37489d4cd' {
menuentry 'Ubuntu, with Linux 4.15.0-54-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-54-generic-init-upstart-c06f67d0-65bb-4544-8d46-12a37489d4cd' {
menuentry 'Ubuntu, with Linux 4.15.0-54-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-54-generic-recovery-c06f67d0-65bb-4544-8d46-12a37489d4cd' {
menuentry 'Ubuntu, with Linux 4.15.0-45-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-45-generic-advanced-c06f67d0-65bb-4544-8d46-12a37489d4cd' {
menuentry 'Ubuntu, with Linux 4.15.0-45-generic (upstart)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-45-generic-init-upstart-c06f67d0-65bb-4544-8d46-12a37489d4cd' {
menuentry 'Ubuntu, with Linux 4.15.0-45-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.15.0-45-generic-recovery-c06f67d0-65bb-4544-8d46-12a37489d4cd' {
menuentry 'System setup' $menuentry_id_option 'uefi-firmware' {
- Select the expected entry name, for example `‘Ubuntu, with Linux 4.15.0-45-generic’
-
$ sudo vim /etc/default/grub
Modify theGRUB_DEFAULT=0
toGRUB_DEFAULT="0>Ubuntu, with Linux 4.15.0-45-generic"
After that, the /etc/default/grub maybe something like the following:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT="0>Ubuntu, with Linux 4.15.0-45-generic"
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
$ sudo update-grub
The settings will have effect the next boot.
Reference
- https://blog.csdn.net/hfutdog/article/details/79331949
- https://blog.csdn.net/v6543210/article/details/82458972