DEV Community

Discussion on: How do I format WSL and start from scratch?

Collapse
nicolus profile image
Nicolas Bailly

Hi !
the most obvious way is to run :
wsl --unregister distribution

where distribution is the name of the distribution you want to "format" (you can get the list of the distributions you have installed by running wsl -l).

So for example if you're using Ubuntu :

wsl --unregister ubuntu
wsl ubuntu
Enter fullscreen mode Exit fullscreen mode

should get you a brand new install of Ubuntu.

Beware that everything that was stored on the wsl drive will be lost, and the command won't ask for a confirmation, so make sure you back up everything you need first !