Ubuntu grub set default entry

  1. $ 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' {
  1. Select the expected entry name, for example `‘Ubuntu, with Linux 4.15.0-45-generic’
  2. $ sudo vim /etc/default/grub
    Modify the GRUB_DEFAULT=0 to GRUB_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=""
  1. $ sudo update-grub

The settings will have effect the next boot.

Reference

  1. https://blog.csdn.net/hfutdog/article/details/79331949
  2. https://blog.csdn.net/v6543210/article/details/82458972
上一篇:探索ASP.NET Core 3.0系列一:新的项目文件、Program.cs和generic host


下一篇:转载:java 泛型详解-绝对是对泛型方法讲解最详细的,没有之一