This article shows how to completely uninstall and remove any Linux distro in Windows Subsystem for Linux without leftover files.
In Windows 11, installing a Linux distro using Windows Subsystem for Linux is pretty easy. All you have to do is find the distro of your choice in the Store and press the install button. Once installed, you can start using it via the terminal and access all the distro files via File Explorer.
If you no longer want to use a specific distro, you can easily uninstall any Linux distro you want from the Windows Subsystem for Linux. For example, I recently wanted to uninstall Ubuntu from WSL. The good thing is, if you follow the steps below, you can remove the Linux distro in Windows without leftover files.
So, without further ado, let me show you how to remove a Linux distro in Windows Subsystem for Linux in Windows.
Table of contents:
- Why remove a Linux distro from WSL?
- Things to consider before uninstalling Linux distro from Windows
- How to remove a Linux distro from Windows Subsystem for Linux (WSL)
- Frequently asked questions
The steps below work the same in Windows 10 and 11.
Why remove a Linux distro from WSL?
There could be several reasons to uninstall and remove a Linux distro from the Windows Subsystem for Linux (WSL) on a Windows system. Some of these include but are not limited to:
- You no longer need the Linux distribution and want to free up resources on your system.
- You want to switch to a different Linux distribution that better meets your needs.
- You encountered problems or issues with the current Linux distribution and want to try a different one.
- You want to reinstall the Linux distribution from scratch to fix any issues or errors that you may be experiencing.
- You want to completely uninstall the WSL module in Windows 10 and 11.
No matter that, Windows makes it easy to uninstall a Linux distro in Windows Subsystem for Linux and remove all the files so that non are leftover.
Important note: Before uninstalling the Linux distro, I recommend you back up the distro files to be safe. That way, you don’t lose access to important files saved in the distro. You can do that by going to the “File Explorer -> Linux” page and opening the Linux distro folder.
Things to consider before uninstalling Linux distro from Windows
Here are a few important things to consider before completely removing a Linux distro from the Windows Subsystem for Linux on Windows:
- Fully back up all the important files stored in the Linux environment.
- Consider whether you’ll need the distro in the future. Though you can install it whenever you want from the Microsoft Store, it is better to keep it than go through the reinstallation & reconfiguration process.
- When facing problems or issues with a specific distro, consider solving them first. That way, you don’t have to go through the reinstallation & reconfiguration process, and you might gain valuable troubleshooting experience.
- Be aware that uninstalling a Linux distro will also remove any tools and software you’ve installed in the distro.
- Be aware that if you have software or tools in your system that depend on a specific WSL Linux distro, removing that distro might stop those tools and software from working or make them behave unpredictably.
How to remove a Linux distro from Windows Subsystem for Linux (WSL)
There are two major steps to get the job done. First, uninstall the Linux distro in Windows and then remove all the leftover files with a single WSL command. As you can guess, cleaning up the leftover files is optional but recommended to ensure a clean removal.
Here’s how to uninstall and remove a Linux distro from WSL:
- Open the Start menu.
- Search for the Linux distro you want to uninstall.
- Right-click on the distro name.
- Choose the “Uninstall” button.
- Press the “Uninstall” option.
- With that, the Linux distro is uninstalled.
- Press the “Win + X” shortcut.
- Choose the “Terminal” option.
- Run the command to get the distro name.
wsl -l -v
- Run the below command to remove distro files.
wsl --unregister Distro-Name
- Close the Terminal window.
- With that, you’ve removed Linux distro files in Windows.
Steps with more details:
First, we must uninstall the distro. To do that, open the Start menu and search for the Linux distro. In my case, I want to uninstall Ubuntu from WSL. So, I searched for it. After that, click the “Uninstall” button on the right panel or right-click on the search result in select “Uninstall.”
Press the “Uninstall” button when prompted for confirmation.
With that, you’ve uninstalled the Linux distro. However, the distro files are still there. You can verify it by opening File Explorer and going to the “Linux” folder on the sidebar. If you are wondering, Windows doesn’t automatically remove the distro file so that you have a chance to back them up.
This is entirely optional, but if you want no leftover files of the uninstalled Linux distro in your system, then we must remove them manually.
To remove the Linux distro files, you must execute a few WSL commands in PowerShell. So, right-click the “Start menu” icon on the taskbar and select the “Terminal” option. Windows 10 users can open PowerShell.
Make sure the PowerShell tab is opened in the terminal window and run the below command. It will show all the distros installed in WSL. Copy the distro name of which you want to remove the files.
wsl -l -v
Once you have the exact distro name, run the below command while replacing
Distro_Name with the actual distro name you got from the earlier command. It will instantly remove the Linux distro from WSL (Windows Subsystem for Linux).
wsl --unregister Distro-Name
To verify, open File Explorer and select “Linux” on the sidebar. You should no longer see the uninstalled Linux distro folder.
Frequently asked questions (FAQ)
Here are a few frequently asked questions about removing a Linux distro from WSL.
Now, removing a Linux distribution will not delete your files. However, you can run a WSL command to manually remove all the uninstall Linux distro files.
Yes, you can remove a single Linux distro from WSL. When you uninstall a Linux distro from WSL, only that distro is uninstalled. Other distros installed in your system are not affected.
Yes, you can reinstall a Linux distro after removing it from WSL via the Microsoft Store.
Yes, uninstalling a Linux distro will also remove any software you installed in it.
That is all. It is that simple to remove a Linux distro from Windows Subsystem for Linux (WSL) in Windows.
I hope this simple and easy Windows how-to guide helped you.
If you are stuck or need help, send an email, and I will try to help as much as possible.