Home » How To » How to Uninstall Linux Distro in Windows Subsystem for Linux (WSL)

How to Uninstall Linux Distro in Windows Subsystem for Linux (WSL)

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:

  1. Why remove a Linux distro from WSL?
  2. Things to consider before uninstalling Linux distro from Windows
  3. How to remove a Linux distro from Windows Subsystem for Linux (WSL)
  4. 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:

  1. You no longer need the Linux distribution and want to free up resources on your system.
  2. You want to switch to a different Linux distribution that better meets your needs.
  3. You encountered problems or issues with the current Linux distribution and want to try a different one.
  4. You want to reinstall the Linux distribution from scratch to fix any issues or errors that you may be experiencing.
  5. 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:

  1. Fully back up all the important files stored in the Linux environment.
  2. 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.
  3. 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.
  4. Be aware that uninstalling a Linux distro will also remove any tools and software you’ve installed in the distro.
  5. 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:

  1. Open the Start menu.
  2. Search for the Linux distro you want to uninstall.
  3. Right-click on the distro name.
  4. Choose the “Uninstall” button.
  5. Press the “Uninstall” option.
  6. With that, the Linux distro is uninstalled.
  7. Press the “Win + X” shortcut.
  8. Choose the “Terminal” option.
  9. Run the command to get the distro name.
    wsl -l -v
  10. Run the below command to remove distro files.
    wsl --unregister Distro-Name
  11. Close the Terminal window.
  12. 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.”

uninstall linux distro from WSL

Press the “Uninstall” button when prompted for confirmation.

click uninstall

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.

Linux distro folder in file explorer

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

get the WSL linux distro name

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

remove linux distro files from WSL

To verify, open File Explorer and select “Linux” on the sidebar. You should no longer see the uninstalled Linux distro folder.

empty Linux folder in file explorer

Frequently asked questions (FAQ)

Here are a few frequently asked questions about removing a Linux distro from WSL.

Will removing a Linux distribution from WSL delete my files or data?

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.

Can I remove a Linux distro without affecting other installed distros?

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.

Can I reinstall a Linux distribution after removing it?

Yes, you can reinstall a Linux distro after removing it from WSL via the Microsoft Store.

Will removing a Linux distro also remove any software or tools that I have installed within the Linux environment?

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.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top