Skip to content

Instantly share code, notes, and snippets.

@vheidari
Last active October 9, 2024 00:34
Show Gist options
  • Save vheidari/04ea783384010aa1d66c23b0099dc949 to your computer and use it in GitHub Desktop.
Save vheidari/04ea783384010aa1d66c23b0099dc949 to your computer and use it in GitHub Desktop.
how to download and install manually wsl2, and linux distor on windows
Manually download Windows Subsystem for Linux distro packages:
# @link: https://docs.microsoft.com/en-us/windows/wsl/install-manual#installing-your-distro
Windows Subsystem for Linux Installation Guide for Windows 10:
# @link: https://docs.microsoft.com/en-us/windows/wsl/install-win10#set-your-distribution-version-to-wsl-1-or-wsl-2
Updating Wsl :
Download Msi Wsl update package from below link then install it :
@link : https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi
Then run this command in your powershell as adminstrator :
- wsl --set-default-version 2
Now downloading and install Linux Distro Manually without microsoft store :
1.0 : Downloading distributions with Invoke-WebRequest or curl :
Invoke-WebRequest :
- Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile Ubuntu-1604.appx -UseBasicParsing
or Curl :
- curl.exe -L -o ubuntu-1604.appx https://aka.ms/wsl-ubuntu-1604
2.0 : Right click on downloaded appex package and run it as administrator. then click on install to install linux package. or use below command in windows powershell
- Add-AppxPackage Ubuntu-1604.appx
3.0 : After install package. Use this command in your powershell to run your linux distor
- wsl.exe -d Ubuntu-16.04
for ubuntu-1804
- wsl.exe -d Ubuntu-18.04
4.0 : To add preceding installed distor ( Ubuntu-16.04 ) in Windows Terminal profiles launcher you should follow theas instaruction on Windows Terminal :
- Ctrl + , #To open Windows Terminal settings
- Click on Add new button in Profiles section
- In General tab insert Name as : Ubuntu-16.04
- In Command line insert launcher Command like this : wsl.exe -d Ubuntu-16.04
- In Starting directory use : %USERPROFILE%
- Than add distor icon in Icon like this : ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png
- Click on save button and finish, congratulations you successfully installing and update own Linxu Distro and Wsl update.
Note: along running wsl distro maybe you get some error about network these instruction help you to fix them.
@link : https://github.com/microsoft/WSL/issues/5336#issuecomment-653881695
=============================================================================
FIX WSL2 NETWORKING IN WINDOWS 10
=============================================================================
cmd as admin:
- wsl --shutdown
- netsh winsock reset
- netsh int ip reset all
- netsh winhttp reset proxy
- ipconfig /flushdns
- Windows Search > Network Reset
- Restart Windows
-----------------------------------------------------------------------------
Note : if you have some problem to run any Linux distro. and maybe you get like this message : "Cannot find the specified path" you should unregister linux distro and install again it. for these purpose :
@link : https://github.com/microsoft/WSL/issues/3976#issuecomment-506951344
=============================================================================
FIX WSL2 Cannot find the specified path IN WINDOWS 10
=============================================================================
cmd as admin:
- wsl --list --all --verbose # show list of distro
- wslconfig /unregister Ubuntu-18.04
- Add-AppPackage Ubuntu-18.04
- wsl.exe -d Ubuntu-18.04
-----------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment