更新 grub 时无法获取规范路径

更新 grub 时无法获取规范路径

所以,我遇到了这个问题,我的 PC 默认情况下不启动 NVME,并且没有在 BIOS 中选择它作为启动选项的选项,但它也有 SATA SSD 和 NVME 插槽并启动 Linux我会按 F12 并从那里选择 NVME 启动选项。否则,它将直接启动至 SATA SSD 上的 Windows。考虑到它是 Alienware X51 R3 并且采用最新的 BIOS,这种行为很奇怪,但该信息仅供参考。

为了解决这个问题,我尝试将 Linux 引导加载程序(我使用 Pop OS 22.04)移动到 SATA SSD,但由于引导分区上没有足够的空间,我最终调整了它的大小,一切顺利。一旦我移动了引导加载程序,我就无法启动 Linux,然后尝试通过 Live CD 进行引导修复,但始终会收到“NVRAM 已锁定”消息。然而,我设法通过使用 Windows 安装 rEFInd 来启动 Linux,尽管现在当我尝试更新系统时却失败并出现以下 grub 错误:

Need to get 0 B/840 kB of archives.
After this operation, 14.8 MB disk space will be freed.
(Reading database ... 570790 files and directories currently installed.)
Removing linux-image-unsigned-6.3.2-060302-generic (6.3.2-060302.202305111150) .../etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-6.3.2-060302-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Sourcing file `/etc/default/grub.d/init-select.cfg'
Generating grub configuration file ...
/usr/sbin/grub-probe: error: failed to get canonical path of `/boot/grub/unicode.pf2GRUB_DISABLE_OS_PROBER=false'.
No path or device is specified.
Usage: grub-probe [OPTION...] [OPTION]... [PATH|DEVICE]
Try 'grub-probe --help' or 'grub-probe --usage' for more information.
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 64
dpkg: error processing package linux-image-unsigned-6.3.2-060302-generic (--remove):
 installed linux-image-unsigned-6.3.2-060302-generic package post-removal script subprocess returned error exit status 1
dpkg: too many errors, stopping
Errors were encountered while processing:
 linux-image-unsigned-6.3.2-060302-generic
Processing was halted because there were too many errors.

这到底意味着什么?我该如何解决它?

答案1

/usr/sbin/grub-probe:错误:无法获取“/boot/grub/unicode.pf2GRUB_DISABLE_OS_PROBER = false”的规范路径。未指定路径或设备。

它看起来很可疑,就像 grub 配置文件中两行不相关的行,/etc/default/grub或者/etc/default/grub.d已合并为一行。

检查 的输出grep -f -R '/boot/grub/unicode.pf2GRUB_DISABLE_OS_PROBER=false' /etc/default

如果存在匹配,请/boot/grub/unicode.pf2GRUB_DISABLE_OS_PROBER=falsegrub 配置文件/etc/default/grub/etc/default/grub.d.

相关内容