dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart List all distribution online
wsl --list --online// list out available distribution
wsl --set-default-version 1// using WSL1 because I have some issue on virtual network with WSL2
wsl --install -d Ubuntu// install Ubuntu WSL
wsl -d Ubuntu// open WSL
If your PC is behind firewall, when you try to install/update package, following error shall occur.
to fix above issues, following below step.
sudo vim ~/.bashrc Add following at the end of file:
export http_proxy=http://<address>:<port>
sudo visudo Add following line after line “Defaults env_reset”
Defaults env_keep = "http_proxy"
Things should be able to run smoothly now.
If adding proxy environment variables still not work, then we can configure the proxy setting directly to apt configuration. Set the content of apt config file /etc/apt/apt.conf as below: Acquire::http::Proxy "http://<proxy-server>:<port>"; Acquire::https::Proxy "https://<proxy-server>:<port>";