C:\Users\<YourUsername>\AppData\Local\Packages\
C:\Users\<YourUsername>\AppData\Local\Microsoft\WindowsApps\
Checking Windows Features
You can also check the Windows Features settings to see if the “Windows Subsystem for Linux” feature is still enabled:
- Press
Win + X
and select “Windows Terminal (Admin)” or “Command Prompt (Admin)” to open a terminal window with administrative privileges. - Run the following command to check the status of the WSL feature:
dism.exe /online /get-features | findstr "Microsoft-Windows-Subsystem-Linux"
If the feature is still enabled, you will see output indicating its presence. If it’s not installed, you won’t see any output.
Checking for WSL files
WSL-related files and directories may still exist on your system even if there are no installed distributions. You can navigate to the following directories to check for remnants of WSL:
C:\Users\<YourUsername>\AppData\Local\Packages\
C:\Users\<YourUsername>\AppData\Local\Microsoft\WindowsApps\
If you see any directories or files related to WSL, it suggests that WSL was previously installed.
Enable WSL 2:
Before installing any WSL distribution, make sure you have WSL 2 enabled on your Windows system. You can do this by running the following commands in PowerShell as an administrator:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
Remove WSL 2 (Optional):
If you also want to remove the WSL 2 feature from your Windows system, you can do so with the following command:
dism.exe /online /disable-feature /featurename:Microsoft-Windows-Subsystem-Linux /norestart