grub-install:错误:找不到 NVME 双启动的 EFI 目录

grub-install:错误:找不到 NVME 双启动的 EFI 目录

进行常规的 Xubuntu 安装。最近每当与 apt 交互时我都会收到以下错误:

$ sudo apt install vim
Reading package lists... Done
Building dependency tree       
Reading state information... Done
vim is already the newest version (2:8.0.1453-1ubuntu1.6).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.

Setting up grub-efi-amd64-signed (1.167~18.04.5+2.04-1ubuntu44.1.2) ...
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
Errors were encountered while processing:
 grub-efi-amd64-signed
E: Sub-process /usr/bin/dpkg returned an error code (1)

请注意,我的系统启动正常,没有遇到任何问题。

我尝试卸载 grub*、重新安装和更新 grub,但均无济于事。这是有关此问题的其他帖子中的建议。

分区设置如下:

sudo blkid

/dev/nvme0n1p1: UUID="<ID>" TYPE="vfat" PARTLABEL="EFI system partition" PARTUUID="<ID>"
/dev/nvme0n1p3: UUID="<ID>" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="<ID>"
/dev/nvme0n1p4: UUID="<ID>" TYPE="ntfs" PARTUUID="<ID>"
/dev/nvme1n1p1: UUID="<ID>" TYPE="vfat" PARTUUID="<ID>"
/dev/nvme1n1p2: UUID="<ID>" TYPE="swap" PARTUUID="<ID>"
/dev/nvme1n1p3: UUID="<ID>" TYPE="ext4" PARTUUID="<ID>"
/dev/loop8: TYPE="squashfs"
/dev/loop9: TYPE="squashfs"
/dev/loop10: TYPE="squashfs"
/dev/loop11: TYPE="squashfs"
/dev/loop12: TYPE="squashfs"
/dev/nvme0n1: PTUUID="<ID>" PTTYPE="gpt"
/dev/nvme0n1p2: PARTLABEL="Microsoft reserved partition" PARTUUID="<ID>"
/dev/nvme1n1: PTUUID="<ID>" PTTYPE="gpt"

mount显示以下内容:

mount  | grep /dev

udev on /dev type devtmpfs (rw,nosuid,relatime,size=16377456k,nr_inodes=4094364,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000)
/dev/nvme1n1p3 on / type ext4 (rw,relatime,errors=remount-ro)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
mqueue on /dev/mqueue type mqueue (rw,relatime)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,pagesize=2M)
/dev/fuse on /run/user/1000/doc type fuse (rw,nosuid,nodev,relatime,user_id=<id>,group_id=<id>)
$ cat /etc/fstab
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/nvme1n1p3 during installation
UUID=<ID> /               ext4    errors=remount-ro 0       1
# /boot/efi was on /dev/nvme0n1p1 during installation
# swap was on /dev/nvme1n1p2 during installation
UUID=<ID> none            swap    sw              0       0
UUID=F030-47FA /boot/efi vfat umask=0077,noauto 0 1
$lsblk -e 7 -o NAME,FSTYPE,LABEL,PARTUUID,MOUNTPOINT,SIZE,MODEL,UUID

NAME        FSTYPE LABEL PARTUUID                             MOUNTPOINT   SIZE MODEL                                    UUID
nvme1n1                                                                  YYY.YG Samsung SSD              
├─nvme1n1p1 vfat         <ID>              YYYM                                          <ID>
├─nvme1n1p2 swap         <ID> [SWAP]      YY.YG                                          <ID>
└─nvme1n1p3 ext4         <ID> /          YYY.YG                                          <ID>
nvme0n1                                                                  YYY.YG Samsung SSD
├─nvme0n1p1 vfat         <ID>              100M                                          <ID>
├─nvme0n1p2              <ID>               16M                                          
├─nvme0n1p3 ntfs         <ID>            YYY.YG                                          <ID>
└─nvme0n1p4 ntfs         <ID>              499M                                          <ID>
First line of fstab matches `nvme1n1p3`
Second line of fstab matches `nvme1n1p2`
Third line of stab matches `nvme0n1p1`

答案1

经过一番尝试和错误后我所做的修复是:

sudo mount /boot/efi 
sudo apt autoremove

至此 apt 就能够完成它在 /boot/efi 上的安装,并且双引导中的两个双系统都按预期工作仍然没有变化。

相关内容