8
If it is, how do I safely remove the Bash on Ubuntu on Windows application while leaving a working Ubuntu and OpenSUSE?
8
If it is, how do I safely remove the Bash on Ubuntu on Windows application while leaving a working Ubuntu and OpenSUSE?
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.
9
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:
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.
this worked thanks – Muhammad Umer – 2019-05-14T23:51:47.383
5
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
lxrun command not found (see other answers...) – rogerdpack – 2019-11-04T13:25:24.923