4

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.

0

2 Answers 2

4

This answer does not apply to Windows 10 version 1709+. If you are running 1709, 1803, or 1809 then you want this. If you are running Windows 10 version 1903+ you want this answer.

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

5
  • 1
    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
    Commented Feb 8, 2019 at 16:51
  • @MiCl - I wrote this answer a year ago. The documentation has changed since I submitted it. I quoted the article for a reason. When this question was asked, this question was correct (it still is correct), based on the when the question was asked. Windows 10 version 1903 is not relevant to this question.
    – Ramhound
    Commented Jul 31, 2019 at 10:51
  • Nothing in the question specifies a specific version of Windows 10. We (as a community) should try to keep answers relevant for the future, and not just relevant for the original question-asker. It doesn't hurt to say "if you're on v1903, here's what you should do; if you're on this other version, here's what you should do".
    – mic
    Commented Jul 31, 2019 at 18:33
  • Any version of Windows 10, including 1903, can have Legacy WSL installed that was carried over from some previous version of Windows.
    – mic
    Commented Jul 31, 2019 at 18:39
  • @MiCl - I already have a version of this answer submitted against a question about more recent versions of Windows 10. This answer is absolutely accurate based on when it was submitted and what was true at the time it was submitted. I won’t be updating this answer since it absolutely is correct.. I don’t expect this answer to ever be referred to, so there is absolutely no incentive to update it with regards to 1803+
    – Ramhound
    Commented Jul 31, 2019 at 21:30
6

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

2
  • 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
    Commented Feb 8, 2019 at 16:43
  • 1
    IIUC the OP is asking how to remove the Legacy distro from before Windows 1709, but your instructions will remove the Ubuntu distro which is the newer one from the Windows Store that they want to keep. Can you please consider changing your answer to wslconfig /u Legacy? Commented Aug 8, 2020 at 22:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .