11

If it is, how do I safely remove the Bash on Ubuntu on Windows application while leaving a working Ubuntu and OpenSUSE?

0
5

Running lxrun /uninstall /full in (e.g.) Windows Powershell with administrative privileges will remove Bash on Ubuntu while leaving your new app-based Ubuntu installation untouched.

1
  • lxrun command not found (see other answers...)
    – rogerdpack
    Nov 4 '19 at 13:25
13

TLDR

wsl --unregister Legacy

Explanation

I believe Christan Davén's answer just removes the shortcut from the start menu, but does not actually remove the WSL (you will still be able to run the WSL by executing C:\Windows\System32\bash.exe and find all of your files and installed apps as you left them).

Silviu's answer is correct. However, if you've upgraded to the Windows 10 Fall Creators Update the lxrun /uninstall /full command will not be available anymore and you should instead run wsl --unregister Legacy.

A third option is to run wslconfig /u Legacy (try this if you are not using Windows Version 1903 or higher).

Source

https://docs.microsoft.com/en-us/windows/wsl/install-legacy#uninstallingremoving-the-legacy-distro

1
11

Since lxrun was deprecated and removed in the Windows 10 April 2018 Update (see Command Reference for Windows Subsystem for Linux), the only way for me to get rid of "Bash on Ubuntu on Windows" was:

  1. Remove Windows Subsystem for Linux (WSL) via the Control Panel
  2. Restart the computer
  3. Try to start "Bash on Ubuntu on Windows"
  4. Agree to remove the shortcut
  5. Re-install WSL
  6. Restart the computer

Hat tip to How-To Geek:

If you’d like to remove the bash.exe tool and the Windows Subsystem for Linux from your computer completely, you’ll need to revisit the “Turn Windows Features On or Off” dialog in the Control Panel.

To find it, open the Control Panel and head to Programs > Turn Windows Features On or Off.

Uncheck the “Windows Subsystem for Linux” option here and click OK. Windows will uninstall the Windows Subsystem for Linux, bash.exe, and lxrun.exe commands. You can always revisit the Windows Features dialog to reinstall them in the future.

0

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.