Windows Linux 子系统上的 grub-pc 更新错误

vla*_*don 6 grub windows-subsystem-for-linux

sudo apt upgrade不断出现以下错误:

$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Setting up grub-pc (2.02~beta2-9ubuntu1.11) ...
grub-probe: error: failed to get canonical path of `rootfs'.
grub-probe: error: failed to get canonical path of `rootfs'.
grub-probe: error: failed to get canonical path of `rootfs'.
/usr/sbin/grub-probe: error: failed to get canonical path of `rootfs'.
dpkg: error processing package grub-pc (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 grub-pc
E: Sub-process /usr/bin/dpkg returned an error code (1)
Run Code Online (Sandbox Code Playgroud)

有办法解决吗?

Windows 10 内部版本 14393

小智 0

查看此 github 评论及其正下方的评论(用于复制可粘贴脚本),了解一些对我有用的解决方案。

为了方便任何人访问,这里是评论的重要文本(如果可以的话,你应该给 github 评论上的人点赞):

(我必须在运行sudo -s或在每行前面加上前缀后执行此操作sudo

cat > /usr/sbin/policy-rc.d <<EOF
#!/bin/sh
exit 101
EOF
chmod +x /usr/sbin/policy-rc.d
dpkg-divert --local --rename --add /sbin/initctl
ln -s /bin/true /sbin/initctl
Run Code Online (Sandbox Code Playgroud)