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

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

When you open the Ubuntu terminal after installation, you’ll see this message:
To run a command as administrator (user “root”), use “sudoTo remove this message, either run a sudo command, such as
sudo apt-get update
(you’ll be asked for your password)

or create the sudo_as_admin_successful file manually
touch ~/.sudo_as_admin_successful
ls -la

If you want the warning back, remove sudo_as_admin_successful
rm ~/.sudo_as_admin_successful