DEV Community


How do I format WSL and start from scratch?

Pacharapol Withayasakpunt
Currently interested in TypeScript, Vue, Kotlin and Python. Looking forward to learning DevOps, though.
・1 min read

Or perhaps restore from Timeshift?

Discussion (1)

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 !