Reinstalling Ubuntu WSL on Windows from PowerShell
This is when you want to throw your build out the window and start fresh:
wsl --unregister Ubuntu
wsl --install -d Ubuntu
Now you can start with a fresh install of Ubuntu in Windows Subsystem for Linux.
To list all registered WSL distributions on your PC, run this command:
wsl --list --verbose
Or the shorthand:
wsl -l -v
This will show output like:
NAME STATE VERSION
* Ubuntu-22.04 Running 2
Debian Stopped 2
-
The
*
indicates the default distribution. -
You can then unregister any of them using:
wsl --unregister <DistributionName>
For example:
wsl --unregister Ubuntu-22.04
Make a backup of anything you need before removing it.
No Comments