I broke the Windows Linux Subsystem (Bash on Ubuntu on Windows 10). Linux Help?

Warning, this process will restore Lxss to initial config

To reinstall the Lxss open Windows cmd as administrator and run:

C:\WINDOWS\system32>LxRun.exe /uninstall

Then:

C:\WINDOWS\system32>LxRun.exe /install

Fixed it.

Ran:

apt-get remove upstart

then

apt-get remove udev

then

apt-get autoremove

and it all seems to be working now.


The official response from microsoft

github:Microsoft/BashOnWindows

This is an issue that everyone will start seeing. We need to add something on this in our official docs.

As @nuclearmistake points out, udev is something that breaks in apt-get but the errors should not cause any issues in WSL. We have reached out to Canonical on this one asking for the best solution and they recommend the following changes:

Write the following to /usr/sbin/policy-rc.d

#!/bin/sh exit 101

chmod +x /usr/sbin/policy-rc.d

dpkg-divert --local --rename --add /sbin/initctl

ln -s /bin/true /sbin/initctl

I have tried this one myself and it looks to work quite well.