14.04 升级触发 grub-pc 失败

Ros*_*iar 10 upgrade boot grub2 dual-boot

我的问题始于从 Ubuntu 12.04 LTS 升级到 14.02 LTS。作为其中的一部分,我收到了一些关于无法删除旧内核的错误消息。

第一次启动到 14.02 时,我通过运行检查一切正常sudo apt-get autoremove,出现了相同的错误。

按照在线指南,我运行了以下内容:

sudo apt-get purge grub-common
sudo apt-get install grub-pc
Run Code Online (Sandbox Code Playgroud)

第一个操作成功了,从我的电脑中删除了 grub。第二次操作失败,结果如下:

Creating config file /etc/default/grub with new version
Installing for i386-pc platform.
Installation finished. No error reported.
Generating grub configuration file ...
Warning: Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.
Found linux image: /boot/vmlinuz-3.13.0-54-generic
Found initrd image: /boot/initrd.img-3.13.0-54-generic
Found linux image: /boot/vmlinuz-3.13.0-44-generic
Found initrd image: /boot/initrd.img-3.13.0-44-generic
Found linux image: /boot/vmlinuz-3.13.0-40-generic
Found initrd image: /boot/initrd.img-3.13.0-40-generic
Adding boot menu entry for EFI firmware configuration
cat: /video.lst: No such file or directory
/usr/sbin/grub-probe: error: failed to get canonical path of `'.
No path or device is specified.
Usage: grub-probe [OPTION...] [OPTION]... [PATH|DEVICE]
Try 'grub-probe --help' or 'grub-probe --usage' for more information.
dpkg: error processing package grub-pc (--configure):
 subprocess installed post-installation script returned error exit status 64
Errors were encountered while processing:
 grub-pc
E: Sub-process /usr/bin/dpkg returned an error code (1)
Run Code Online (Sandbox Code Playgroud)

我为此尝试了许多修复程序,其中大部分都记录在此处。我删除之前创建一个LiveCD grub-common,所以我有机会到我的旧分区,而且可以mountchroot进去。

但是当运行update-grub出现相同的错误时,我也无法在dpkg --configure -a没有发生这种情况的情况下运行。

我曾经为我的机器boot-repair获取启动摘要,这是一个 2 HDD 装备,第一个驱动器上有双启动 ( /dev/sda)。随着Windows/dev/sda1和我Ubuntu的分区(也引导)/dev/sda2

请帮我解决这个问题,我保证我再也不会碰我的 Ubuntu 安装了。:-)

Ros*_*iar 11

我使用以下方法“优雅地解决了”我的问题:

sudo apt-get purge grub-pc grub-common
sudo rm -r /etc/grub.d/
sudo apt-get install grub-pc grub-common
sudo grub-install /dev/sda
sudo update-grub
Run Code Online (Sandbox Code Playgroud)

删除/etc/grub.d/目录似乎已经摆脱了12.04我潜伏的任何文件,允许14.04继续安装 grub!

虽然我当然会建议备份您将要删除的任何内容。

  • 这确实解决了问题,非常感谢! (2认同)
  • 我在寻找解决方案时发现了这个问题,其中显示了我在运行 apt upgrade 时收到的消息“dpkg: error processing package grub-pc (--configure)”。只做`apt-get purge grub-pc grub-common; apt-get install grub-pc grub-common; update-grub` 解决了这个问题。 (2认同)