The Windows Subsystem for Linux lets developers run a GNU/Linux environment -- including most command-line tools, utilities, and applications -- directly on Windows, unmodified, without the overhead of a traditional virtual machine or dualboot setup.
WSL has been a revolutionary feature for us geeks and developers for many reasons. Whether you just want to dip your toes into Linux or a seasoned pro, no need to perform a dual boot.
However, you will come across an instance where you no longer need the installed Linux distribution on your system.
Method 1 - Uninstall WSL Distribution Using Windows Settings
The first and most common method you can use to remove any WSL distribution is using the Settings App. WSL distributions are treated as regular windows applications from the Windows store.
Hence to uninstall the distro from Settings,
Right Click the Start Menu and Select Settings.
In the Settings App, Navigate to the Apps section.
Navigate to the installed Apps section.
Locate the Linux distribution you wish to unistall and click on the three-dots icon. Select Uninstall to remove the distro from your system.
Wait from the unistall process to complete. Once finished, your Linux distribution should be completely removed from your system.
Method 2 - Uninstall WSL Distro Using Windows Command Prompt or PowerShell
For most of us, we do not wish to navigate all the way to the settings up while we already have a terminal session up and running.
Therefore, we need a way to uninstall a WSL distribution from the terminal.
To unistall a WSL distro, run the command:
winget rm --name <distro_name>
winget rm --name Ubuntu
Found Ubuntu [CanonicalGroupLimited.Ubuntu_79rhkp1fndgsc] Starting package uninstall... ██████████████████████████████ 100% Successfully uninstalled
Method 3 - Uninstall a Custom WSL Distro
In some cases, you may wish to remove a distro that is not available from the Windows Store.
An example is the Arch Linux.
In such case, you can install your distro by open the command prompt with administrive permissions.
Execute teh command:
wsl --unregister <distr_name>
<distro_name>is the name of the distribution you wish to remove. You can find the distro name by runninng the command:
Windows Subsystem for Linux Distributions: Debian (Default) fedoraremix Arch
For example, to uninstall Arch Linux:
wsl --unregister Arch
Through this post, you discovered 3 main ways of uninstalling a WSL distribution from your Windows 10 or Windows 11 system.
Leave us a comment down below and share with your friends.