Notes activating Windows Subsystem for Linux (WSL) and installing Ubuntu (ver 20.04 LTS) on my Windows 10 Home (21H1) PC.
Modified from
- https://docs.microsoft.com/en-us/windows/wsl/install-win10
- https://www.windowscentral.com/how-install-wsl2-windows-10
Note also includes instructions to install Homebrew
Enable WSL
- Open PowerShell as Administrator
- Run at command line
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
Enable Virtual Machine platform
- Assuming system meets requirements for WSL2, proceed to enable virtual machine platform. Run at command line
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
- Download wsl_update_x64.msi.
- Restart PC to complete WSL install and update WSL2.
Install update package
- Run wsl_update_x64.msi, the Linux kernel package. Follow instructions as presented.
Set WSL 2 as default version
- Open Powershell as Administrator. Run
wsl --set-default-version 2
Get Linux distro from Microsoft Store.
- I installed Ubuntu 20.04 LTS. As of 26 July 2021, Direct url https://www.microsoft.com/store/apps/9n6svws3rx71
- After installation, launch UBUNTU (e.g., start menu) to finish Linux setup.
Update Linux
#download package information sudo apt update #install packages from sources listed in /etc/apt/sources.list. sudo apt upgrade
Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
test install
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
Update gcc
brew install gcc