Ubuntu on WSL2 is a popular choice for running Linux directly inside Windows. However, sometimes you may want to remove Ubuntu to free up disk space, reinstall it from scratch, or completely uninstall it. This guide explains in detail the different ways to remove Ubuntu from WSL2, along with data warnings and extra tips to ensure you do it safely and correctly.
Check Your Ubuntu Version in WSL2
Before removing Ubuntu, you need to identify the exact distribution name. Open PowerShell and run:
wsl -l -v
Example output:
NAME STATE VERSION
* Ubuntu-22.04 Stopped 2
Ubuntu-24.04 Stopped 2

This shows that you may have multiple versions of Ubuntu installed at the same time.
Method 1: Remove Ubuntu Data from WSL2
⚠️ Warning: This will permanently delete all data inside Ubuntu and cannot be recovered. Make sure to back up your files first.
If you just want to reset Ubuntu but keep the app from the Microsoft Store:
- Open PowerShell as Administrator.
- Run the command:
wsl --unregister Ubuntu-22.04

This completely wipes the file system, user accounts, and data inside Ubuntu.
💡 Tip: After unregistering, simply open the Ubuntu app again from the Start Menu, and it will reinstall automatically.
Method 2: Completely Uninstall the Ubuntu Application
If you want to remove both the Ubuntu app and all its data:
- Go to Settings → Apps → Installed apps.
- Type Ubuntu in the search box.
- Select the correct version (e.g., Ubuntu-22.04).
- Click Uninstall to completely remove it.
💡 Why: This removes both the app and the distro, freeing up more disk space. This method is best if you no longer need Ubuntu in WSL2 at all.
When Should You Use Each Method?
- Method 1: When you want to reset Ubuntu or reinstall another distribution.
- Method 2: When you don’t need Ubuntu in WSL2 anymore.
FAQ
Ubuntu is broken. How should I remove it?
→ Use wsl --unregister <distro_name>
to wipe it, then reopen the Ubuntu app to reinstall.
Can I remove multiple Linux distributions from WSL2 at once?
→ Yes, just run wsl --unregister <distro_name>
for each one (e.g., Ubuntu-22.04, Debian).
Does uninstalling Ubuntu in WSL also remove Windows Subsystem for Linux itself?
→ No. Removing Ubuntu only affects that distribution. WSL2 remains installed so you can use or install other distros.
Removing Ubuntu from WSL2 can be done in two ways: either reset it with wsl --unregister
or completely uninstall it via Settings. With the warnings and tips above, you can perform these steps safely and keep your system clean and organized.