升级期间读取 EFI 变量 (SecureBoot) 时出错,grub-efi-amd64-signed 和 shim-signed 更新失败

升级期间读取 EFI 变量 (SecureBoot) 时出错,grub-efi-amd64-signed 和 shim-signed 更新失败

几周前,我使用命令sudo apt update和在 Ubuntu Server 20.04 LTS 上执行了常规软件更新sudo apt upgrade。通常,此过程会顺利完成,但这次在设置时冻结了secureboot-db。按 Crtl+C 停止该软件包的更新后,apt继续升级并遇到其他一些问题:grub-install无法安装 x86_64-efi 平台。

经过一番研究,我发现其他人也遇到了同样的问题,并通过取消软件包更新来“解决”了这个问题secureboot-dbhttps://askubuntu.com/a/1095718)。下一次更新一切顺利:grub 已更新,我可以重新启动回到 Ubuntu 而没有任何问题。

今天,我需要安装一个新软件包,我觉得在apt upgrade安装之前先安装一下是个好主意。几分钟后,我看到一个红色的弹出窗口,上面写着:

### Configuring grub-efi-amd64 ###
GRUB failed to install to the following devices: /dev/sda1
Do you want to continue anyway? If you do, your computer may not start up properly.
YES - NO

选择“否”后,系统要求我选择 efi 分区(已选择)并尝试再次安装。几秒钟后,红色弹出窗口再次出现。最后,我按下“是”,升级继续,退出时出现 2 个失败的软件包:grub-efi-amd64-signedshim-signed

以下是 的完整输出apt upgrade

~$ 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.
1 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.142.8+2.04-1ubuntu26.6) ...
od: /sys/firmware/efi/efivars/SecureBoot-8be4df61-93ca-11d2-aa0d-00e098032b8c: read error: Interrupted system call
/usr/share/grub/grub-check-signatures: 22: [: Illegal number: 
dpkg: error processing package grub-efi-amd64-signed (--configure):
 installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 255
dpkg: dependency problems prevent processing triggers for 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 triggers unprocessed
Errors were encountered while processing:
 grub-efi-amd64-signed
 shim-signed
E: Sub-process /usr/bin/dpkg returned an error code (1)

因此看起来读取 EFI 变量存在问题SecureBoot

我应该担心吗?我该如何升级这些软件包而不出现任何错误?我能正常启动吗?

我还没有重新启动我的机器,因为我担心它可能无法重新启动到 Ubuntu。

我读过一些其他帖子和网站,但没有一个解决我遇到的相同问题:

我相信我的机器上的 SecureBoot 已被禁用,但我无法回去检查它,因为我可能无法回到 Ubuntu。

以下是一些其他命令的输出:

~$ sudo grub-install
Installing for x86_64-efi platform.
grub-install: warning: Cannot read EFI Boot* variables.
grub-install: warning: efivarfs_get_variable: read failed: Interrupted system call.
grub-install: warning: efi_get_variable: ops->get_variable failed: Interrupted system call.
grub-install: error: failed to register the EFI boot entry: Interrupted system call.

~$ sudo update-grub
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-52-generic
Found initrd image: /boot/initrd.img-5.4.0-52-generic
Found linux image: /boot/vmlinuz-5.4.0-51-generic
Found initrd image: /boot/initrd.img-5.4.0-51-generic
  /dev/sdb: open failed: No medium found
  /dev/sdb: open failed: No medium found
done

~$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
loop0    7:0    0  55.3M  1 loop /snap/core18/1885
loop1    7:1    0  69.2M  1 loop /snap/lxd/18077
loop2    7:2    0  69.2M  1 loop /snap/lxd/18013
loop3    7:3    0    31M  1 loop /snap/snapd/9721
loop5    7:5    0    31M  1 loop /snap/snapd/9607
loop6    7:6    0  55.4M  1 loop /snap/core18/1932
sda      8:0    0 279.5G  0 disk 
├─sda1   8:1    0   512M  0 part /boot/efi
└─sda2   8:2    0   279G  0 part /
sr0     11:0    1  1024M  0 rom  

任何帮助是极大的赞赏!

相关内容