grub-install 重新安装 grub 失败:
Installing for x86_64-efi platform.
grub-install: warning: Internal error.
grub-install: error: failed to register the EFI boot entry: Operation not permitted.
我在执行升级时注意到,尝试升级软件包 grub-efi-amd64-signed。这给出了一个更具信息性的错误消息:
Installing grub to /boot/efi.
Installing for x86_64-efi platform.
grub-install: warning: Internal error.
grub-install: error: failed to register the EFI boot entry: Operation not permitted.
mount: /var/lib/grub/esp: mount point does not exist.
系统正在尝试在 /var/lib/grub/esp 上查找 EFI 分区
这很奇怪,因为我的 fstab 看起来正确,
/dev/sda7 有 boot 标志,/dev/sda2 有 esp 标志。我不知道为什么 grub-install 会转到 /var/lib 来尝试查找 efi 分区。即使我明确将目录传递给 grub-install,错误仍然存在。
grub-install --efi-directory=/boot/efi/ --boot-directory=/boot/
我尝试运行启动修复,但并没有解决问题。
答案1
答案2
关闭快速启动 UEFI 设置后,grub-install 问题消失。我还按照 @oldfred 的建议从 Windows 本身关闭了快速启动。grub-install
有效。但是,当我升级 grub-efi-amd64-signed 包时,我仍然收到相同的 /var/lib/grub/esp 错误:
Setting up grub-efi-amd64-signed (1.142.9+2.04-1ubuntu26.7) ...
Installing grub to /boot/efi.
Installing for x86_64-efi platform.
Installation finished. No error reported.
mount: /var/lib/grub/esp: mount point does not exist.
dpkg: error processing package grub-efi-amd64-signed (--configure):
installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 32
Errors were encountered while processing:
grub-efi-amd64-signed
之后,通过运行以下命令清除 grub 并重新安装 grub 解决了grub-efi-amd64-signed
安装问题。
sudo apt-get purge grub\*
sudo apt-get install grub-efi
sudo apt-get autoremove
sudo update-grub