author_profile_image

mariangela

Updated on June 26, 2024

Category:

env

Tags:

Linux

Ubuntu 22.04 LTS

Windows 11

Install WSL

Windows Subsystem for Linux

A faster way to install Linux with WSL2

How to install Ubuntu 24.04 LTS with WSL2 in just a couple of steps

Open Windows Command Prompt and run the following command to list all the valid distributions that can be installed

wsl --list --online
list installable linux distributions

Let’s install Ubuntu 24.04 LTS. You’ll be asked to create a user and be prompted to enter a password

wsl --install -d Ubuntu-24.04
install Ubuntu 24.04 LST

When you open the Ubuntu terminal after installation, you’ll see this message:

To run a command as administrator (user “root”), use “sudo ”. See “man sudo_root” for details.

To remove this message, either run a sudo command, such as

sudo apt-get update

(you’ll be asked for your password)

remove message at the top of Ubuntu terminal

or create the sudo_as_admin_successful file manually

touch ~/.sudo_as_admin_successful
ls -la
sudo_as_admin_successful

If you want the warning back, remove sudo_as_admin_successful

rm ~/.sudo_as_admin_successful