How to Remove or Uninstall Ubuntu Linux on Windows WSL

This article describes steps one can take to completely uninstall or delete a Ubuntu Linux distribution on Windows 11 with WSL.

Windows Subsystem for Linux lets developers run a GNU/Linux environment, including most command-line tools, utilities, and applications directly in Windows without setting up a virtual machine or dual-boot.

If you no longer want to run a Ubuntu Linux distribution within your Windows WSL environment, Windows allows you to completely remove it in multiple ways.

Ubuntu Linux and other Linux distributions are available through the Microsoft Store which they are considered applications. Since they are applications, you can use the Windows Settings app or the Command Prompts to uninstall these distributions.

Below is how to uninstall Ubuntu Linux on Windows with WSL.

How to uninstall Ubuntu Linux on Windows WSL

As described above, if you no longer want to run a Ubuntu Linux distribution within your Windows WSL environment, Windows allows you to completely remove it in multiple ways.

Below are some of the ways to uninstall the Ubuntu Linux distribution on Windows 11 WSL.

Uninstall Ubuntu Linux on Windows WSL via the Settings app

One way users can remove or uninstall a Ubuntu Linux from the Windows WSL environment is via the Settings app.

Since Linux distributions are installed through the Microsoft Store, they are considered apps and can be removed or uninstalled like any app.

First, open the Windows Settings app. You can get to the Settings app by clicking on the Start button and selecting Settings.

windows 11 new settings button
windows 11 new settings button

When the Settings app opens, go to Apps -> Installed apps (Apps & features). On the list of installed apps, find the Ubuntu Linux app, then click on the menu option (three dots on right) and select Uninstall.

uninstall ubuntu from wsl windows 11
uninstall ubuntu from west windows 11

Uninstall Ubuntu Linux on Windows WSL via Command Prompt

Another way one can remove or uninstall Ubuntu Linux from the Windows WSL environment is via the command prompt.

First, open the Command Prompt or Windows PowerShell as administrator.

To list all installed apps, simply run the commands below.

winget list

This will list all installed packages. From the list, identify the Ubuntu Linux package.

Name                                                         Id                                                  Version             Available Source
-----------------------------------------------------------------------------------------------------------------------------------------------------
Visual Studio Community 2022                                 Microsoft.VisualStudio.2022.Community               17.4.0              17.4.1    winget
HP Smart                                                     AD2F1837.HPPrinterControl_v10z8vjag6ke6             140.1.307.0
Ubuntu on Windows                                            Canonical.Ubuntu                                    2004.2022.1.0                 winget
Microsoft Edge                                               Microsoft.Edge                                      107.0.1418.42                 winget
Microsoft Edge Update                                        Microsoft Edge Update                               1.3.171.37
Microsoft Edge WebView2 Runtime                              Microsoft.EdgeWebView2Runtime                       107.0.1418.42                 winget
Cortana                                                      Microsoft.549981C3F5F10_8wekyb3d8bbwe               4.2204.13303.0
App Installer                                                Microsoft.DesktopAppInstaller_8wekyb3d8bbwe         1.18.2691.0
Xbox                                                         Microsoft.GamingApp_8wekyb3d8bbwe                   2211.1001.24.0
Get Help                                                     Microsoft.GetHelp_8wekyb3d8bbwe                     10.2208.2551.0
Microsoft Tips                                               Microsoft.Getstarted_8wekyb3d8bbwe                  10.2207.2.0
HEIF Image Extensions                                        Microsoft.HEIFImageExtension_8wekyb3d8bbwe          1.0.43012.0

Under the package ID column, location the name of the package. Use the command format below to uninstall the package.

winget uninstall --id "UbuntuPackageName"

For example, run the commands below to uninstall Ubuntu.

winget uninstall --id Canonical.Ubuntu

Uninstall Ubuntu Linux from Windows WSL via wsl.exe

If the Ubuntu Linux distribution was imported, you may not find it under the installed apps section. You may have to run the commands below to uninstall.

Open the Command Prompt or Windows PowerShell as administrator.

Then run the commands below to list the Ubuntu Linux distros.

wsl --list

Run the command format below.

wsl --unregister Ubuntu-linux-name

For example, run the commands to uninstall Ubuntu.

wsl --unregister Ubuntu

That should do it!

Conclusion:

This post showed you how to uninstall Ubuntu Linux from the Windows WSL environment. If you find any error above or have something to add, please use the comment form below.