启动时出错:未知命令’gfxmode’。 按任意键继续

当我启动Linux时,我得到了这个:

Error: unknown command 'gfxmode'. Pressing any key continues 

之后启动大约需要5秒钟。 我认为与11.10相比相当慢。 无论如何,我的Ubuntu是12.04,它今天刚刚更新,并用grubcustomizer更改了grub。 无论如何,我不想在grub定制器上使用任何gfx接口或分辨率,但即使没有在grub定制器中标记它也会一直给出错误。

我在这里找到了一些帮助,在这个问题中: 错误:未知命令’gfxmode’。 按任意键继续

我在00_header找到了它提到的00_header 。 但是在那里的gfx前面找到了gfx ,所以这实际上不是问题所在。

这是我的/ etc / default / 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="saved" #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="" # Uncomment to enable BadRAM filtering, modify to suit your needs # This works with Linux (no patch required) and with any kernel that obtains # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef" # Uncomment to disable graphical terminal (grub-pc only) #GRUB_TERMINAL="console" # The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE # you can see them in real GRUB with the command `vbeinfo' #GRUB_GFXMODE="1024x768x24" # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux #GRUB_DISABLE_LINUX_UUID="true" # Uncomment to disable generation of recovery mode menu entries #GRUB_DISABLE_RECOVERY="true" # Uncomment to get a beep at grub start #GRUB_INIT_TUNE="480 440 1" GRUB_SAVEDEFAULT="true" 

打开/etc/grub.d/proxifiedScripts/linux

 gksu gedit /etc/grub.d/proxifiedScripts/linux 

接下来,在该文件中搜索gfxmode $linux_gfx_mode

用#like(仅在你需要它的情况下)注释掉这一行:

#gfxmode $linux_gfx_mode

这将解决问题,但如果你想修复gfxmode编辑该行,以便它说:

 set gfxmode=\$linux_gfx_mode 

保存文件。

  • 注意:同一目录中可能存在较旧的脚本文件,这些文件也会使错误永久化。 我做了上述修改,却发现grub还在“gfxmode”线上徘徊。 在/etc/grub.d/proxifiedScripts目录中,我还找到了一个名为“ linux~1 ”的文件。 显然,该目录中的任何脚本文件都会被执行。 在任何情况下,当我在“ linux~1 ”文件中以相同的方式编辑相同的行并更新grub时,问题就消失了。 我的猜测是“linux~1”是脚本的旧版本,我可能应该简单地将其删除(或者将其修改为非可执行文件)。

然后,您将需要使用以下命令更新grub:

  sudo update-grub 

我使用启动修复软件重新安装GRUB。

然后问题解决了。

你可以看到我对这个bug的评论。

https://bugs.launchpad.net/ubuntu/+source/grub2/+bug/998835