Skip to content

Commit dc6fffc

Browse files
authored
Merge pull request #98 from krzysiekwie/ODA-85-Ubuntu-WSL2
update and improve guide
2 parents 76ac672 + c2c051c commit dc6fffc

File tree

1 file changed

+66
-30
lines changed

1 file changed

+66
-30
lines changed

wsl/how-to/install-ubuntu-wsl2.md

Lines changed: 66 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,106 @@
11
# Install Ubuntu on WSL2
22
*Authored by Oliver Smith ([[email protected]](mailto:[email protected])) and edited by Edu Gómez Escandell ([[email protected]](mailto:[email protected]))*
33

4-
## What you will learn:
4+
## What you will learn
55

66
* How to enable and install WSL on Windows 10 and Windows 11
7+
* How to install `Ubuntu 24.04 LTS` using the Microsoft Store, WSL commands or the Winget package manager
78

8-
## What you will need:
9+
## What you will need
910

10-
* A Windows 10 or Windows 11 physical or virtual machine with all the updates installed
11+
* Windows 10 or 11 running on either a physical device or virtual machine
12+
* All of the latest Windows updates installed
1113

1214
## Install WSL
1315

14-
WSL can be installed from the command line. Open a PowerShell prompt as an Administrator (we recommend using Windows Terminal) and run:
15-
```
16+
You can install WSL from the command line. Open a PowerShell prompt as an Administrator (we recommend using [Windows Terminal](https://github.com/microsoft/terminal?tab=readme-ov-file#installing-and-running-windows-terminal)) and run:
17+
18+
```text
1619
wsl --install
1720
```
1821

1922
This command will enable the features necessary to run WSL and also install the default Ubuntu distribution of Linux available in the Microsoft Store. It is recommended to reboot your machine after this initial installation to complete the setup. You can also install WSL from the Microsoft Store.
2023

2124
## Install Ubuntu WSL
2225

23-
WSL supports a variety of Linux distributions including the latest Ubuntu release. Check out [the documentation](../reference/distributions.md) to see which one you prefer. For the rest of this tutorial we'll use `Ubuntu` as the example.
26+
WSL supports a variety of Linux distributions including the latest Ubuntu LTS release. Check out [the documentation](../reference/distributions.md) to see which one you prefer.
2427

25-
There are multiple ways of installing distros on WSL, here we show three: via the Microsoft store, via Winget, and the WSL CLI. The result is equivalent.
28+
There are multiple ways of installing distros on WSL, here we show three: Microsoft Store, WSL commands and the Winget package manager. The result is the same regardless of the method.
2629

27-
### Method 1: Microsoft store
30+
### Method 1: Microsoft Store
2831

29-
Find the distribution you prefer on the Microsoft Store and then select `Get`.
32+
Find the distribution you prefer on the Microsoft Store and then click **Get**.
3033

3134
![|624x489](https://github.com/ubuntu/WSL/blob/main/docs/guides/assets/install-ubuntu-wsl2/choose-distribution.png?raw=true)
3235

33-
Ubuntu will then be installed on your machine. Once installed, you can either launch the application directly from the store or search for Ubuntu in your Windows search bar.
36+
Ubuntu will then be installed on your machine. Once installed, you can either launch the application directly from the Microsoft Store or search for Ubuntu in your Windows search bar.
3437

3538
![|624x580](https://github.com/ubuntu/WSL/blob/main/docs/guides/assets/install-ubuntu-wsl2/search-ubuntu-windows.png?raw=true)
3639

37-
### Method 2: WSL Command line interface
40+
### Method 2: WSL commands
41+
42+
It is possible to install the same Ubuntu versions available on the Microsoft Store directly from the command line.
43+
In a PowerShell terminal, you can run `wsl --list --online` to see an output with all available distros and versions:
44+
45+
```text
46+
The following is a list of valid distributions that can be installed.
47+
The default distribution is denoted by '*'.
48+
Install using 'wsl --install -d <Distro>'.
3849
39-
It is possible to install the same Ubuntu applications available on the Windows Store directly from the command line.
40-
In a PowerShell terminal, you can run `wsl --list --online` to see all available distros.
50+
NAME FRIENDLY NAME
51+
* Ubuntu Ubuntu
52+
Debian Debian GNU/Linux
53+
kali-linux Kali Linux Rolling
54+
Ubuntu-18.04 Ubuntu 18.04 LTS
55+
Ubuntu-20.04 Ubuntu 20.04 LTS
56+
Ubuntu-22.04 Ubuntu 22.04 LTS
57+
Ubuntu-24.04 Ubuntu 24.04 LTS
58+
...
4159
42-
![image|690x388](https://github.com/ubuntu/WSL/blob/main/docs/guides/assets/install-ubuntu-wsl2/wsl-list-online.png?raw=true)
60+
```
4361

44-
You can install a distro using the NAME by running:
62+
Your list may be different once new distributions become available.
63+
64+
You can install a version using a NAME from the output:
65+
66+
```text
67+
wsl --install -d Ubuntu-24.04
4568
```
46-
wsl --install -d Ubuntu-20.04
69+
70+
You'll see an indicator of the installation progress in the terminal:
71+
72+
```text
73+
Installing: Ubuntu 24.04 LTS
74+
[==========================72,0%========== ]
4775
```
4876

49-
![image|690x388](https://github.com/ubuntu/WSL/blob/main/docs/guides/assets/install-ubuntu-wsl2/installing.png?raw=true)
77+
Use `wsl -l -v` to see all your currently installed distros and the version of WSL they are using:
5078

51-
Use `wsl -l -v` to see all your currently installed distros and which version of WSL they are using:
79+
```text
80+
NAME STATE VERSION
81+
Ubuntu-20.04 Stopped 2
82+
* Ubuntu-24.04 Stopped 2
83+
```
5284

53-
![image|690x311](https://github.com/ubuntu/WSL/blob/main/docs/guides/assets/install-ubuntu-wsl2/wsl-l-v.png?raw=true?raw=true)
85+
### Method 3: Win package manager
5486

55-
### Method 3: Winget
5687
Open a PowerShell terminal and type:
57-
```powershell
58-
winget show --name Ubuntu --source msstore
88+
89+
```text
90+
win show --name Ubuntu --source msstore
5991
```
6092

61-
You'll see a list of distros available and their ID. Choose the one you prefer and install it. For instance, Ubuntu:
62-
```powershell
63-
winget install --Id "9PDXGNCFSCZV" --source msstore
93+
You'll see a list of available distros and their Ids. Choose the one you prefer and install it. For instance, for `Ubuntu 24.04 LTS`:
94+
95+
```text
96+
win install --Id "9NZ3KLHXDJP5" --source msstore
6497
```
6598

6699
You'll be prompted to accept the source and package agreements before installing. You need to accept them in order to proceed.
67100

68101
Check out [the documentation](../reference/distributions.md) to see which executable matches your application and run it.
69-
```
102+
103+
```text
70104
ubuntu.exe
71105
```
72106

@@ -76,18 +110,20 @@ Congratulations, you now have an Ubuntu terminal running on your Windows machine
76110

77111
Once it has finished its initial setup, you will be prompted to create a username and password. They don't need to match your Windows user credentials.
78112

79-
Finally, it’s always good practice to install the latest updates with the following commands, entering your password when prompted.
80-
```bash
113+
Finally, it’s always good practice to install the latest updates with the following commands, entering your password when prompted:
114+
115+
```text
81116
sudo apt update
82117
sudo apt full-upgrade -y
83118
```
84119
## Enjoy Ubuntu on WSL!
85120

86-
That’s it! In this tutorial, we’ve shown you how to install WSL and Ubuntu on Windows 11, set up your profile, install a few packages, and run a graphical application.
121+
In this guide, we’ve shown you how to install WSL and Ubuntu on Windows 10 or 11 and the latest updates.
87122

88-
We hope you enjoy working with Ubuntu inside WSL. Don’t forget to check out [our blog](https://ubuntu.com/blog) for the latest news on all things Ubuntu.
123+
We hope you enjoy working with Ubuntu in WSL. Don’t for to check out [our blog](https://ubuntu.com/blog) for the latest news on all things Ubuntu.
89124

90125
### Further Reading
126+
91127
* [Setting up WSL for Data Science](https://ubuntu.com/blog/upgrade-data-science-workflows-ubuntu-wsl)
92128
* [Whitepaper: Ubuntu WSL for Data Scientists](https://ubuntu.com/engage/ubuntu-wsl-for-data-scientists)
93129
* [Microsoft WSL Documentation](https://learn.microsoft.com/en-us/windows/wsl/)

0 commit comments

Comments
 (0)