How to reset WSL distribution?

QuestionsQuestions8 SkillsProPermissions of FilesOct, 27 2025
01.2k

To reset a WSL (Windows Subsystem for Linux) distribution, you can follow these steps:

Method 1: Reset via Windows Settings

  1. Open Windows Settings:

    • Press Windows + I to open the Settings app.
  2. Navigate to Apps:

    • Click on Apps.
  3. Find Your WSL Distribution:

    • In the Apps & features section, scroll down to find your installed WSL distribution (e.g., Ubuntu).
  4. Access Advanced Options:

    • Click on the distribution name, and then click on Advanced options.
  5. Reset the Distribution:

    • In the Advanced options menu, scroll down and click the Reset button. This will reset the distribution to its initial state, deleting all files and settings.

Method 2: Unregister and Reinstall the Distribution

If you prefer to completely remove and then reinstall the distribution, you can do so using PowerShell:

  1. Open PowerShell as Administrator:

    • Right-click on the Start button and select Windows PowerShell (Admin).
  2. Unregister the Distribution:

    • Run the following command to unregister (remove) the distribution:
      wsl --unregister <DistributionName>

    Replace <DistributionName> with the name of your distribution (e.g., Ubuntu).

  3. Reinstall the Distribution:

    • After unregistering, you can reinstall the distribution using:
      wsl --install -d <DistributionName>

    For example:

    wsl --install -d Ubuntu

Conclusion

Choose the method that best suits your needs. Resetting via Windows Settings is straightforward and keeps the distribution installed, while unregistering and reinstalling will give you a fresh start. Remember that resetting or unregistering will delete all files and settings in the distribution, so back up any important data before proceeding.

0 Comments

no data
Be the first to share your comment!