Reset Manual Installation of Windows Subsystem for Linux – How to

windows-subsystem-for-linux

Related: Is there a way of installing Windows Subsystem for Linux on Win10 (v1709) without using the Store?

When installing a WSL distribution outside of the Microsoft Store (for example on a restricted network, see linked), many of the standard means of interacting with that distribution are not available. In my example, when I go through Settings > Apps and Features, the distro is not shown in the list and the management features are not available. If I get my manually installed linux instance into a bad state, what is the correct way to reset it and bring it back to a fresh install?

Edit: Examples of a 'bad state' encountered thus far include a BSOD during an 'apt-get update', leading to an unrecoverable state. Also, performing multiple configuration changes to troubleshoot a problem, removing or disabling services and installing other packages without keeping close track of what was changed, with a desire to "start fresh" to test if the solution arrived at does in fact work on its own..

Best Answer

If I get my manually installed Linux instance into a bad state, what is the correct way to reset it and bring it back to a fresh install?

If you are running Windows 10 Version 1903:

wsl --unregister <DistributionName>

If you are running Windows 10 Version 1709, 1803, or 1809:

wslconfig /unregister <DistributionName>

Manage and configure Windows Subsystem for Linux

Related Question