PowerShell – Install Ubuntu WSL (Linux On Windows)

| | | | |

If you have issues like I have had with the Windows Store this will help you to get Ubuntu WSL on Windows.

NOTE: You may need to reboot your computer after the first line.

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
#Install-WindowsFeature -Name Microsoft-Windows-Subsystem-Linux

Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1604 -OutFile ~/Downloads/ubuntu-1604.zip
New-Item -Path c:\ubuntu-1604 -ItemType Directory
Expand-Archive -Path ~/Downloads/ubuntu-1604.zip -OutputPath c:\ubuntu-1604 -Force
Set-Location c:\ubuntu-1604
& .\ubuntu1604.exe

Invoke-WebRequest -Uri https://aka.ms/wsl-ubuntu-1804 -OutFile ~/Downloads/ubuntu-1804.zip
New-Item -Path c:\ubuntu-1804 -ItemType Directory
Expand-Archive -Path ~/Downloads/ubuntu-1804.zip c:\ubuntu-1804
Set-Location C:\ubuntu-1804
& .\ubuntu1804.exe
Originally Posted on August 25, 2020
Last Updated on August 17, 2024
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.