How to Uninstall Ubuntu from WSL A Step-by-Step Guide

Uninstall Ubuntu WSL correctly from windows

Uninstall Ubuntu WSL correctly from windows

troubleshooting wsl
wsl
uninstall ubuntu
wsl uninstallation
ubuntu

Using the Start menu is one of the easiest ways to uninstall Ubuntu from WSL. Follow the steps below:

  1. Search Ubuntu in the Start menu.
  2. Click on Uninstall in the right pane.search and uninstall ubuntu from start menu
  3. This should uninstall Ubuntu WSL and its related information from the WSL.

Check for Remaining WSL Distributions

  1. Open terminal and check the list of WSL distributions
    wsl -list
    check wsl list
  2. Sometimes the uninstall doesn’t work as expected.For example, you might have uninstalled WSL Ubuntu-20.04, but it still shows up in the terminal:
    C:\Users\sabbirz>wsl -l
    Windows Subsystem for Linux Distributions:
    Ubuntu-22.04 (Default)
    Ubuntu-20.04
    unregister ubuntu
  3. If this happens, try unregistering the distro with the following command
    C:\Users\sabbirz>wsl --unregister Ubuntu-20.04
    Unregistering.
    The operation completed successfully.
  4. Check if the distro is successfully unregistered
    C:\Users\sabbirz>wsl -l
    Windows Subsystem for Linux Distributions:
    Ubuntu-22.04 (Default)

Additional Troubleshooting

  • Common Errors and Fixes:
    • If you encounter an error stating that the distribution is still in use, make sure all instances of the distribution are closed. You can use wsl --terminate <DistroName> to forcefully terminate any running instances.
  • Reinstalling WSL:
    • If problems persist, consider reinstalling WSL or resetting it to defaults. This can be done via the Windows Features dialog or PowerShell.