To completely uninstall WSL (Windows Subsystem for Linux) and remove both the Ubuntu and podman-machine-default distributions from your system, please follow these steps:
1. Unregister and Uninstall the Linux Distributions
First, you need to unregister (delete) the installed Linux distributions. This will remove all data associated with them.
a. Open Command Prompt or PowerShell as Administrator:
- Click on the Start menu.
- Type
cmd or PowerShell.
- Right-click on Command Prompt or Windows PowerShell and select Run as administrator.
b. List Your Installed Distributions (Optional):
To confirm the distributions installed, run:
wsl -l -v
c. Unregister the Distributions:
Run the following commands to unregister both Ubuntu and podman-machine-default:
wsl --unregister Ubuntu
wsl --unregister podman-machine-default
This action will remove the distributions and all associated data from your system.
2. Uninstall the Linux Distributions from Windows (If Applicable)
If you installed Ubuntu or other distributions via the Microsoft Store, you should also uninstall them from Windows to remove any remaining files.
a. Go to Settings > Apps > Apps & Features:
- Press
Win + I to open Settings.
- Click on Apps, then Apps & Features.
b. Uninstall the Distributions:
- Scroll through the list or use the search bar to find Ubuntu or any other Linux distributions.
- Click on the distribution and select Uninstall.
3. Disable the Windows Subsystem for Linux Feature
To completely remove WSL from your system, you need to disable it from Windows Features.
a. Turn Off WSL via Control Panel:
- Open Control Panel.
- Navigate to Programs > Programs and Features.
- Click on Turn Windows features on or off on the left sidebar.
- In the list, uncheck Windows Subsystem for Linux.
- Click OK.
b. Or Use PowerShell to Disable WSL:
Run the following command in an elevated PowerShell prompt:
Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
c. Restart Your Computer:
You will be prompted to restart your computer. Save any open work and reboot to apply the changes.
4. Uninstall the WSL Update (If Installed from Microsoft Store)
If you've installed the latest version of WSL from the Microsoft Store, you should uninstall it as well.
a. Go to Settings > Apps > Apps & Features:
- Press
Win + I to open Settings.
- Click on Apps, then Apps & Features.
b. Uninstall Windows Subsystem for Linux:
- Use the search bar to find Windows Subsystem for Linux.
- Click on it and select Uninstall.
5. Verify WSL is Uninstalled
After your system restarts:
- Open Command Prompt or PowerShell.
- Run
wsl or wsl -l -v.
You should receive a message indicating that WSL is not installed, or it might prompt you to install it.
Note: These steps will completely remove WSL and all associated Linux distributions from your system. If you plan to use WSL in the future, you will need to re-install it and any distributions you wish to use.