friendly-recovery is broken, keeps returning exit status 1

by Zackary   Last Updated September 07, 2018 21:01 PM

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
exit 101
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:

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.

Related Questions

Installing libsdl2-dev on Kali 3.18.0 amd64

Updated June 05, 2015 22:00 PM

Tell dpkg that a dependency is installed when it is not

Updated September 25, 2017 17:01 PM