Tips:
一般情况下,虚拟机启动时,长按 ESC键就会出现,实体机请参考:Ubuntu启动时无法进入menu菜单选项解决方案。
解决教程
1、打开系统命令行,使用管理员身份编辑 /etc/default/grub 文件,命令如下:
Ubuntu-user:~/Desktop$ su
Password:
root@Ubuntu-PC:/home/Ubuntu-user/Desktop$ gedit /etc/default/grub
grub文件主要内容如下:
# 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
GRUB_TIMEOUT_STYLE=hidden
GRUB_TIMEOUT=0
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
2、修改 GRUB_TIMEOUT_STYLE=hidden、GRUB_TIMEOUT=0的默认值,修改完成后保存,如下:
# 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
#把hidden 隐藏,修改成菜单
GRUB_TIMEOUT_STYLE=menu
#把超时时间0秒,修改成5秒【根据个人需要修改】
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
3、退出root用户,使用普通用户执行如下命令,使得修改的grub文件生效,如下:
root@Ubuntu-PC:/home/Ubuntu-user/Desktop$ exit
#此处有的用户可能是 sudo update-grub2 命令【两者等同,无任何区别,只是不同系统版本有所差别】
Ubuntu-user:~/Desktop$ sudo update-grub
[sudo] password for Ubuntu-user:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.2.0-39-generic
Found initrd image: /boot/initrd.img-6.2.0-39-generic
Found linux image: /boot/vmlinuz-5.15.0-43-generic
Found initrd image: /boot/initrd.img-5.15.0-43-generic
Found memtest86+ image: /boot/memtest86+.elf
Found memtest86+ image: /boot/memtest86+.bin
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
done
Ubuntu-user:~/Desktop$
4、此时我们再次重启系统,就发现启动菜单 Menu又重新回来啦,如图: