DEV Community

Pacharapol Withayasakpunt
Pacharapol Withayasakpunt

Posted on

How do I format WSL and start from scratch?

Or perhaps restore from Timeshift?

Top comments (1)

Collapse
 
nicolus profile image
Nicolus

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 !