从17.10升级到18.04时出现错误(shim-signed和grub-efi-amd64-signed)。

今天早上运行了sudo do-release-upgrade来将我的系统从Ubtunu 17.10升级到18.04 LTS,但在升级过程中遇到了错误。追踪信息太长无法完整贴出,但以下是我认为可能是问题所在的部分:
Rebuilding /usr/share/applications/bamf-2.index...
Errors were encountered while processing:
 shim-signed
 grub-efi-amd64-signed
Exception during pm.DoInstall():  E:Sub-process /usr/bin/dpkg returned an error code (1)

Could not install the upgrades 

The upgrade has aborted. Your system could be in an unusable state. A 
recovery will run now (dpkg --configure -a). 

Setting up shim-signed (1.34.9+13-0ubuntu2) ...
Installing for x86_64-efi platform.
Could not add entry to BootOrder: Interrupted system call
grub-install: error: efibootmgr failed to register the boot entry: No such device or address.
dpkg: error processing package shim-signed (--configure):
 installed shim-signed package post-installation script subprocess returned error exit status 1
Setting up grub-efi-amd64-signed (1.93+2.02-2ubuntu8) ...
Installing for x86_64-efi platform.
Could not add entry to BootOrder: Interrupted system call
grub-install: error: efibootmgr failed to register the boot entry: No such device or address.
dpkg: error processing package grub-efi-amd64-signed (--configure):
 installed grub-efi-amd64-signed package post-installation script     subprocess returned error exit status 1
Errors were encountered while processing:
 shim-signed
 grub-efi-amd64-signed

Upgrade complete

The upgrade has completed but there were errors during the upgrade process.

我已经浏览了论坛上的解决方案,并可以预先确认,/etc/fstab 中的条目没有被注释掉。执行 cat /etc/fstab 命令会输出以下内容:
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda9 during installation
UUID=a2f91309-dc7e-4456-b3ef-89900b145365 /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/sda2 during installation
UUID=90EA-4FB8  /boot/efi       vfat    umask=0077      0       1
# swap was on /dev/sda6 during installation
UUID=2f80d8f4-5609-45e1-854d-578ab25836c3 none            swap    sw              0       0

系统是双启动的,装有Windows 10。通过lsb_release -a命令,我可以确认我的Ubuntu分区已经更新到18.04 LTS版本,但这些错误让我感到不安,我不希望它们在长期使用中引起问题。谢谢。

你的系统能正常启动进入Ubuntu吗? - Organic Marble
2是的,系统启动得很好。 - R. Barrett
有趣的问题。我认为你没什么问题,但希望一些专家能给出一个确切的答案。 - Organic Marble
https://bugs.launchpad.net/ubuntu/+source/grub2-signed/+bug/1753518 - Rqomey
1个回答

我遇到了完全相同的错误。为了升级剩下的最后两个包,我找到了一个解决方案:
sudo su -
cd /boot/efi/EFI
mv ubuntu ubuntu-old
apt install -f
mv ubuntu-old ubuntu
update-grub2
exit

希望能有所帮助。

有趣的解决方案。您能解释一下为什么要在apt install -f之前执行mv ubuntu ubuntu-old并进行恢复吗? - WinEunuuchs2Unix
1@WinEunuuchs2Unix 看起来新版本的 grub 由于某种原因无法访问 /boot/efi/EFI/ubuntu 目录。所以既然我的系统正常启动,我只想摆脱每次使用 apt 时出现的错误。所以我想到了一个变通方法,只是为了检查安装是否完成,看起来这个方法行得通。最后,我恢复了 ubuntu 目录的名称,以免影响系统的启动能力。看来,我忘了提到之后要执行 update-grub2 命令。 - George Tavantzopoulos
好像很有效。非常感谢! - R. Barrett
1这个方法对我有效,所以我在Launchpad的错误报告中发布了解决方案:https://bugs.launchpad.net/ubuntu/+source/grub2-signed/+bug/1753518 - Rqomey
这对我在Ubuntu 18.04上使用第二个SSD驱动器安装的Uuntu系统(Linux stephane-N56VM 4.15.0-50-generic #54-Ubuntu SMP Mon May 6 18:46:08 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux)有效。 - Stéphane V