0

I installed WSL back when it was still in beta, in 2016. A few days ago, I also installed Ubuntu from the Windows store, which has a more recent version (18.04), and spiffy text colours (and I presume other improvements under the hood).

I'd like to remove WSL, since I don't really need two Linux shells on my machine. Is it possible to do this? If so, how would I go about doing it? I've copied everything I need from my WSL directories to the new subsystem.

1

I'd like to remove WSL, since I don't really need two Linux shells on my machine. Is it possible to do this? If so, how would I go about doing it?

You simply run the following command in an elevated PowerShell prompt.

lxrun /uninstall /full

If you upgrade to Windows 10 Fall Creators Update from an earlier Windows 10 release upon which you installed WSL, your existing distro will remain intact. However, we STRONGLY encourage you to install a new Store-delivered distro ASAP and migrate any necessary files, data, etc. from your legacy distro to your new distro. To remove the legacy distro from your machine, run the following from a Command Line or PowerShell instance

You can also remove the legacy instance manually by running the following command in an elevated PowerShell prompt.

rm -Recurse $env:localappdata/lxss/

If you wish, you can manually delete your legacy instance. This may be required if you encounter issues uninstalling the legacy distro using lxrun.exe, or are running Windows 10 Spring 2018 Update (or later) which do not ship with lxrun.exe.

Uninstalling/Removing the legacy distro

  • This answer absolutely is NOT deprecated. It only applies if you are running Windows 10 1607 or Windows 10 1703. The author had installed WSL on an earlier version of Windows 10, my answer is written specifically for that situation. I have written an entirely different answer, How can the bash shell on Window be completely reset?, if you happen to running Windows 10 1709+ – Ramhound Feb 8 at 16:51
0

The above answer is now deprecated (February '19). Use this instead:
WSLconfig /u Ubuntu

You can and should also uninstall the App via Windows 10 settings -> Apps. Source: https://github.com/Microsoft/WSL/issues/2703

  • The question is asking specifically how to remove the legacy WSL Ubuntu installation. You still have to use lxrun /uninstall /full to accomplish that task on 1709 or greater if it was originally installed when the system was running 1703 or 1607. The legacy WSL Ubuntu instance, CANNOT be removed, from within the Windows 10 UWP application. Sadly, this answer does not apply to the author's question. I have already answered how you Reset the WSL Ubuntu install on 1709 or greater. – Ramhound Feb 8 at 16:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.