How to install
wsl --install # This will install Ubuntu
wsl -l -v # List your installed Linux distributions and check the version of WSL each is set to
If you don’t want to install Ubuntu visit https://learn.microsoft.com/en-us/windows/wsl/install to learn about other options.
Useful resources
- Basic commands for WSL: Basic commands for WSL | Microsoft Learn
Useful commands
List all available Linux distributions
wsl --list --online
List of installed Linux distributions
wsl --list --verbose
Update WSL
wsl --update
Troubleshooting
Slow network or unable to fetch updates
If you 1) get errors such as Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease Temporary failure resolving 'archive.ubuntu.com'
and/or 2) the network speed when installing updates seems incredibly slow, and/or 3) you cannot install basic apps such as ranger
because of an Unable to locate package
error, then it’s likely a DNS issue. You can resolve it by:
- Opening /etc/resolv.conf
sudo nano /etc/resolv.conf
- Changing the nameserver
nameserver 1.1.1.1 # Cloudflare