I have Windows Subsystem for Linux running Ubuntu 16.04 (but with Linux Mint 19 packages). At one point, I made the mistake of installing a different kernel, which also installed grub-pc
and friendly-recovery
. I managed to remove grub-pc
with apt
, but friendly-recovery
is stuck. I have tried the following to remove it:
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
#### Next command tried
apt remove friendly-recovery
#### Next command tried
dpkg --remove --force-remove-reinstreq friendly-recovery
#### Finally...
dpkg --purge --force-remove-reinstreq friendly-recovery
None of them removed friendly-recovery
. I always get this log output:
(Reading database ... 145035 files and directories currently installed.)
Removing friendly-recovery (0.2.38) ...
/usr/sbin/grub-probe: error: failed to get canonical path of `rootfs'.
dpkg: error processing package friendly-recovery (--purge):
installed friendly-recovery package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
friendly-recovery
This solution on GitHub didn't fix my issue.
I am now stuck not being able to change the installed packages (apt
and dpkg
always error processing friendly-recovery
, no matter what package I am trying to install/remove).
What can I do to fix this? I can't think of anything but fully reinstalling WSL.