In recent times, installing the Windows Subsystem for Linux (WSL) on Windows 10 and Windows 11 has become much easier. We're at the point now where you can either install it from the Microsoft Store or enter a single command in the terminal to be on your merry way.
One of the many benefits of WSL is that you can set up a full Linux distro and integrate it into your Windows workflow without fear of breaking anything important on your PC. It's a virtual machine, but one that interacts with your Windows installation, and if anything should go wrong you can simply destroy it and start again.
But how do you actually remove a Linux distro installed in WSL? On the face of things, you might think you just have to uninstall the "app" for the particular distro you installed, but that's only half of the battle. Here's how to completely remove it.
How to completely remove a Linux distro from WSL
Indeed you can simply right-click and uninstall Ubuntu, Debian, or any of the other Linux distros you might have set up on WSL. Installing them is as easy as downloading from the Microsoft Store, and removing them is as easy as any other Store app. Alternatively, you can do the same with winget in the terminal if you're a fan of using the Windows Package Manager.
But this doesn't completely remove all traces. Data and the file system created will be left behind, so for that, you need to instruct WSL to remove it in the terminal. So do the uninstalling of the app second, ideally.
Here's what you need to do.
- Open up PowerShell.
- To get the exact name for the distro you want, enter
wsl -l -v.
- Enter into the terminal
wsl --unregister <distro name>.
The unregister option will tell WSL to completely destroy all traces of the file system and any data contained within it. So, for example, if you wanted to remove an installation of Debian your command would look like this:
wsl --unregister Debian
It's case sensitive, too, and has to be exact, which is why it's a good idea to run Step Two first. Ubuntu, for example, has a number of different versions, and you may well need to be specific to a version number, such as Ubuntu 20.04. Though this will depend on which package you installed in the first instance.
This process should remove any associated file systems, but it's worth opening up File Explorer and having a look just to make sure. WSL file systems are easily accessed from the sidebar, and if anything is left behind you can just manually delete it.
Backing up and importing to WSL
While WSL can be disposable, it's also a good idea to back up your installations so if you do get rid of one you can get back to where you were a little easier.
Backing up is a pretty straightforward process that involves exporting to a .tar file. Our guides on exporting and importing Linux installs in WSL will take you through the process step by step, but the main commands you need are as follows:
wsl --export <distro> <filename.tar>wsl --import <distro> <install location=""> <filename> </filename></install></distro></filename.tar></distro>
The process doesn't take too long, and it's particularly useful if you plan on making frequent changes to your WSL installs.
Richard Devine is an Editor at Windows Central. A former Project Manager and long-term tech addict, he joined Mobile Nations in 2011 and has been found on Android Central and iMore as well as Windows Central. Currently you'll find him covering all manner of PC hardware and gaming, and you can follow him on Twitter and Instagram.
Nice informative article! Now, how did you make your taskbar transparent?
TransparentTB can grab it from the Microsoft Store :)
Awesome, thank you
You can also use a GUI, when you dont want to use the WSL command https://github.com/FalconNL93/WslToolbox
Get the best of Windows Central in in your inbox, every day!
Thank you for signing up to Windows Central. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.