由于 grub-efi-amd64-signed,Ubuntu 22.04 在 apt 升级期间出现 BIOS 启动错误

由于 grub-efi-amd64-signed,Ubuntu 22.04 在 apt 升级期间出现 BIOS 启动错误

我有一个远程 Ubuntu 服务器,运行了几个月,没有出现任何问题。刚才,在 期间apt full-upgrade,我收到以下错误:

Setting up grub-efi-amd64-signed (1.182~22.04.1+2.06-2ubuntu10) ...
mount: /var/lib/grub/esp: special device /dev/sda15 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
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
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)

这对我来说很奇怪,因为我在 BIOS 启动时安装了 Ubuntu 22.04.1 LTS。我认为这些很久以前就不应该起作用了,但直到现在它们才起作用。

$ [ -d /sys/firmware/efi ] && echo UEFI || echo BIOS
BIOS

我有这些驱动器,只有/dev/sda一个系统驱动器,其/dev/sda2分区为/boot

$ sudo parted -l
Model: ATA HGST HUH721010AL (scsi)
Disk /dev/sda: 10.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: pmbr_boot

Number  Start   End     Size    File system     Name  Flags
 5      1049kB  2097kB  1049kB                        bios_grub
 1      2097kB  17.2GB  17.2GB  linux-swap(v1)        swap
 2      17.2GB  18.3GB  1074MB  ext3
 3      18.3GB  2181GB  2163GB  ext4
 4      2181GB  10.0TB  7820GB  ext4


Model: ATA HGST HUH721010AL (scsi)
Disk /dev/sdb: 10.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  10.0TB  10.0TB  ext4


Model: ATA HGST HUH721010AL (scsi)
Disk /dev/sdc: 10.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  10.0TB  10.0TB  ext4


Model: ATA HGST HUH721010AL (scsi)
Disk /dev/sdd: 10.0TB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags:

Number  Start   End     Size    File system  Name  Flags
 1      1049kB  10.0TB  10.0TB  ext4

答案1

我在远程服务器上遇到了完全相同的问题。相同的操作系统版本,相同的问题和相同的grub-efi-amd64-signed软件包版本。

就我而言,我有一个 RAID 驱动器,带有 BIOS 启动。apt除此以外的所有命令apt update都给出了完全相同的错误:

mount: /var/lib/grub/esp: special device /dev/sda15 does not exist.

其他资源建议运行apt purge grub\*然后重新安装适当的软件包,但就我而言,清除不起作用。

我最终通过下面的命令删除了有shim-signed问题的 grub 包。虽然我的理解是我们真的grub-efi*不需要shim-signedBIOS 启动请注意,shim-signed 被标记为受保护的包,因此删除它可能会导致启动时出现进一步的问题!

# Use with caution!
dpkg --purge --force-all grub-efi-amd64
dpkg --purge --force-all grub-efi
dpkg --purge --force-all grub-efi-amd64-signed
dpkg --purge --force-all shim-signed

之后,我运行了,apt upgrade没有apt autoremove任何问题,并且在重启期间/之后也没有遇到任何问题。希望这能有所帮助...

相关内容