Reputation: 71
I want to install an Ubuntu image in WSL.
But, I get a error when running wsl --install
:
Invalid command line option: --install
I am using windows 10 education, version 20H2 OS Build 19042.867.
Upvotes: 5
Views: 35581
Reputation: 5091
First of all, the linux distributions that can be installed are listed in Windows PowerShell:
wsl --list --online
This command returns a list of linux distributions that can be installed as follows:
NAME FRIENDLY NAME
Ubuntu Ubuntu
Debian Debian GNU/Linux
kali-linux Kali Linux Rolling
Ubuntu-18.04 Ubuntu 18.04 LTS
Ubuntu-20.04 Ubuntu 20.04 LTS
Ubuntu-22.04 Ubuntu 22.04 LTS
OracleLinux_7_9 Oracle Linux 7.9
OracleLinux_8_7 Oracle Linux 8.7
OracleLinux_9_1 Oracle Linux 9.1
openSUSE-Leap-15.5 openSUSE Leap 15.5
SUSE-Linux-Enterprise-Server-15-SP4 SUSE Linux Enterprise Server 15 SP4
SUSE-Linux-Enterprise-15-SP5 SUSE Linux Enterprise 15 SP5
openSUSE-Tumbleweed openSUSE Tumbleweed
A version name to be installed is selected and the installation is done with the -d
parameter:
wsl --install -d Ubuntu-22.04
Upvotes: 3
Reputation: 168
Make sure you follow the official instructions: https://learn.microsoft.com/windows/wsl/install
Crucial is the Windows version: For Windows 10, it should be version 2004 or higher (Build 19041 or higher). Windows 11 should work with all versions.
Older versions need to follow the manual installation procedure: https://learn.microsoft.com/en-us/windows/wsl/install-manual
Upvotes: 0
Reputation: 8407
You are attempting to work from Windows Insider documentation, which is not meant for the general public, and it says so. WSL/WSL2 is a fast-moving target.
Most people should use the Microsoft Store to install WSL / WSL2. Search for Ubuntu. Several choices will be displayed. Pick the one simply called Ubuntu, not Ubuntu 20.04 LTS or whatever. The Ubuntu package is kept current.
VSCode has current instructions for installing Ubuntu, then VSCode. You don't have to install VSCode.
Upvotes: 3