Ubuntu 14.04 中的 Grub 更新警告

JoK*_*KeR 44 grub2

我试图更新 Grub 所以我运行:

sudo update-grub

Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Run Code Online (Sandbox Code Playgroud)

这个警告究竟想改变什么?(我之前从 12.04 升级到 14.04)

这是我的/etc/default/grub文件:

GRUB_DEFAULT="0"
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=""
Run Code Online (Sandbox Code Playgroud)

cha*_*kes 45

您不能同时使用GRUB_HIDDEN_TIMEOUT设置和GRUB_TIMEOUT设置。即使隐藏超时设置为 0,也是如此。

您可以注释掉不需要的行。

例如:

#GRUB_HIDDEN_TIMEOUT=0
Run Code Online (Sandbox Code Playgroud)

保存更改后,sudo update-grub再次运行。

  • 这只是取决于你想要什么。如果您只有 ubuntu,则 0 适合 timout。如果你是双引导,你需要一些时间(比如 10)来选择要引导的操作系统。有关更多信息,请参阅 [配置 grub2](https://help.ubuntu.com/community/Grub2/Setup#Configuring_GRUB_2) (3认同)

Maj*_*jal 26

简短的回答:

#GRUB_HIDDEN_TIMEOUT=0
#GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT_STYLE=hidden
Run Code Online (Sandbox Code Playgroud)

或者只是删除上面条目中的前两行并将其替换为

GRUB_TIMEOUT_STYLE=[menu|countdown|hidden]
Run Code Online (Sandbox Code Playgroud)

解释:

截至此时(2016 年),GRUB_HIDDEN_TIMEOUTGRUB_HIDDEN_TIMEOUT_QUIET选项已被弃用。所以不要再使用它们了。相反,您可以使用GRUB_TIMEOUT_STYLE.

根据info -f grub -n 'Simple configuration',你有这个:

'GRUB_TIMEOUT_STYLE'

 If this option is unset or set to 'menu', then GRUB will display
 the menu and then wait for the timeout set by 'GRUB_TIMEOUT' to
 expire before booting the default entry.  Pressing a key interrupts
 the timeout.

 If this option is set to 'countdown' or 'hidden', then, before
 displaying the menu, GRUB will wait for the timeout set by
 'GRUB_TIMEOUT' to expire.  If <ESC> is pressed during that time, it
 will display the menu and wait for input.  If a hotkey associated
 with a menu entry is pressed, it will boot the associated menu
 entry immediately.  If the timeout expires before either of these
 happens, it will boot the default entry.  In the 'countdown' case,
 it will show a one-line indication of the remaining time.
Run Code Online (Sandbox Code Playgroud)