请参阅以下日志。我从 18.10 升级到 19.04 Ubuntu 后遇到了这个问题,请建议我修复。谢谢。
royal:~$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
2 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up grub-efi-amd64-signed (1.115+2.02+dfsg1-12ubuntu2) ...
Installing for x86_64-efi platform.
Could not prepare Boot variable: Function not implemented
grub-install: error: efibootmgr failed to register the boot entry: Input/output error.
dpkg: error processing package grub-efi-amd64-signed (--configure):
installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of shim-signed:
shim-signed depends on grub-efi-amd64-signed | grub-efi-arm64-signed; however:
Package grub-efi-amd64-signed is not configured yet.
Package grub-efi-arm64-signed is not installed.
dpkg: error processing package shim-signed (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
grub-efi-amd64-signed
shim-signed
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
我在使用从 18.10 升级到 19.04 后遇到了这个问题sudo apt dist-upgrade
。GRUB 无法正常工作,幸运的是,我的 Ubuntu 正在启动,可能是它被 EFI 机制识别了。
我的研究得出结论,这个错误的原因一定是更新版本的libefivar1
库。我已将其及其依赖项降级为 Ubuntu 18.10 提供的最新版本。
首先,我去了Ubuntu 软件包并下载以下软件包cosmic
发布到单独的文件夹,例如grub fix
:
grub-efi-amd64-bin
grub-efi-amd64-signed
grub-common
grub-pc
grub-pc-bin
grub2-common
os-prober
grub-gfxpayload-lists
libefivar1
efibootmgr
efivar
之后,我删除了 19.04 disco 版本附带的最新版本中的这些软件包:
sudo apt remove grub-efi-amd64-bin grub-efi-amd64-signed grub-common grub-pc grub-pc-bin grub2-common os-prober grub-gfxpayload-lists libefivar1
并安装先前下载的发布软件包cosmic
:
cd grub\ fix/
sudo dpkg -i *.deb
最后,阻止他们升级是一个好主意:
sudo apt-mark hold grub-efi-amd64-bin grub-efi-amd64-signed grub-common grub-pc grub-pc-bin grub2-common os-prober grub-gfxpayload-lists libefivar1
在 Ubuntu 开发人员提供永久修复后,以下内容应将软件包升级到最新的 19.04 版本:
sudo apt-mark unhold grub-efi-amd64-bin grub-efi-amd64-signed grub-common grub-pc grub-pc-bin grub2-common os-prober grub-gfxpayload-lists libefivar1
sudo apt upgrade
如果你根本无法启动新安装的 Ubuntu 19.04,也许你可以将我的步骤与这个答案使用实时 Ubuntu 19.04 或者直接使用这些步骤在 18.10 上使 Ubuntu 再次启动。