Uninstall Ubuntu Pro for WSL, Ubuntu on WSL and WSL¶
This page briefly outlines the steps required to uninstall Ubuntu Pro for WSL, Ubuntu distros, and WSL itself.
Ubuntu Pro for WSL¶
Uninstall the Pro for WSL app¶
Go to Settings > Apps > Installed Apps, locate the “Ubuntu Pro for WSL”
application, right-click on it and select Uninstall.
If you installed the app using WinGet, you can instead run the following command in PowerShell:
> winget uninstall Canonical.UbuntuProforWSL
Remove Pro for WSL data¶
Remove .ubuntupro from your Windows user profile directory.
> Remove-Item -Recurse -Force C:\Users\<username>\.ubuntupro
Remove registry key¶
If you or your organisation used the Windows Registry to store any configuration data, such as a Pro token, remove the matching registry key:
> Remove-Item -Recurse -Force HKCU:\Software\Canonical\UbuntuPro
Ubuntu distros¶
Stop WSL¶
In PowerShell, run the following command to stop WSL:
> wsl --shutdown
Uninstall Ubuntu distros¶
The method to uninstall an Ubuntu distro depends on the installation format.
For installations that use the modern tar-based installation format, run:
> wsl --unregister <distro>
If a distribution was installed in the legacy format, go to Settings > Apps > Installed Apps, locate the Ubuntu distro, right-click on it, and select
Uninstall.
Tip
While installing Ubuntu in the legacy format, a message appears in the terminal recommending the modern tar-based format.
If you don’t know the format of an installed distro, run:
> Get-ChildItem "HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss"
Distros installed using the tar-based format include the property modern with
value 1.
WSL app¶
Only uninstall WSL if you no longer need WSL on your Windows machine:
> wsl --uninstall
Note
Running wsl --install for the first time enables the Virtual Machine
Platform, if it is disabled. Uninstalling WSL does not disable the Virtual
Machine Platform, and it needs to be disabled manually.