尝试在 ubuntu 18.04 上安装 gnupg 时出现 grub-install 错误

尝试在 ubuntu 18.04 上安装 gnupg 时出现 grub-install 错误

我正在尝试在 Ubuntu 18:04 系统上升级 mongodb,执行命令时出现以下错误:

sudo apt-get install gnupg

这是错误:

Setting up grub-efi-amd64-signed (1.187.2~18.04.1+2.06-2ubuntu14) ...
Installing for x86_64-efi platform.
grub-install: error: cannot find EFI directory.
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 (>= 1.167~) | grub-efi-arm64-signed (>= 1.167~); 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

答案1

您当前有两个处于未完全安装状态的软件包:grub-efi-amd64-signedshim-signed。此消息表明这些软件包未能完全安装的可能原因:

grub-install: error: cannot find EFI directory.

显然你的EFI系统分区没有安装在/boot/efi,或者有问题。

您应该在尝试安装任何新软件(如gnupg)之前修复此问题。

这些更新可能与 Ubuntu 的旧安全启动证书被列入黑名单有关(因为与 BootHole 相关的安全漏洞),因此,如果您启用了安全启动并且fwupd已经提供了最新的安全启动黑名单 ( dbx) 更新,您的系统可能无法在更新shim-signedgrub-efi-amd64-signed完全安装之前,无需禁用安全启动或其他手动操作即可启动。

相关内容