microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.24k stars 811 forks source link

wsl --install -d Ubuntu still installs 20.04 instead of 22.04 #8402

Open danielniccoli opened 2 years ago

danielniccoli commented 2 years ago

Version

Microsoft Windows [Version 10.0.19044.1645]

WSL Version

Kernel Version

5.10.102.1

Distro Version

Ubuntu

Other Software

No response

Repro Steps

C:\>wsl --unregister ubuntu
Unregistering...

C:\>wsl -l -v
Windows Subsystem for Linux has no installed distributions.
Distributions can be installed by visiting the Microsoft Store:
https://aka.ms/wslstore

C:\>wsl --list --online
The following is a list of valid distributions that can be installed.
Install using 'wsl --install -d <Distro>'.

NAME            FRIENDLY NAME
Ubuntu          Ubuntu
Debian          Debian GNU/Linux
kali-linux      Kali Linux Rolling
openSUSE-42     openSUSE Leap 42
SLES-12         SUSE Linux Enterprise Server v12
Ubuntu-16.04    Ubuntu 16.04 LTS
Ubuntu-18.04    Ubuntu 18.04 LTS
Ubuntu-20.04    Ubuntu 20.04 LTS

C:\>wsl --install -d Ubuntu
Downloading: Ubuntu
Installing: Ubuntu
Ubuntu has been installed.
Launching Ubuntu...

C:\>wsl -- lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:        20.04
Codename:       focal

Expected Behavior

I expected WSL to download the latest Ubuntu version for distribution Ubuntu, which is 22.04.

(Long-term support releases have dedicated distribution names like Ubuntu-16.04, Ubuntu-18.04 and Ubuntu-20.04.)

Actual Behavior

Distribution Ubuntu was on version 20.04.

Diagnostic Logs

No response

elsaco commented 2 years ago

@danielniccoli use winget and the store ID "9PN20MSR04DW" to install, or the name "Ubuntu 22.04 LTS". It will pull the correct version.

PS C:\> winget show --name "Ubuntu 22.04 LTS"
Found Ubuntu 22.04 LTS [9PN20MSR04DW]
danielniccoli commented 2 years ago

@elsaco Appreciate you found a workaround until it is fixed.

dgutson commented 2 years ago

wsl --list --online doesn't show 22.04

ghost commented 2 years ago

I get this exact same issue, 22.04 is not in the online list of WSL distributions.

Unfortunately I can't use the "winget" workaround, as I can't install the extra package due to work's GPO settings.

Biswa96 commented 2 years ago

Ubuntu 22.04 was added in the manual installation page. Direct link https://aka.ms/wslubuntu2204

ghost commented 2 years ago

Ubuntu 22.04 was added in the manual installation page. Direct link https://aka.ms/wslubuntu2204

Thanks for update Biswa96.

Our work uses GPO to block access to MS Store, this link allowed me to manually download it and install as my standard user account. WSL has already been enabled on our workstations by administrators.

The only issue I had with manual installation was NS not working in /etc/resolv.conf. During the "Updating Settings" step, I had to drop to console to change NS ipaddress, then the installation was able to complete.. must be a step in the install to do some online step.

After reboot, all worked fine.

aradalvand commented 2 years ago

Any updates on this? 22.04 still doesn't show up when you run wsl --list --online. Why is that?

wolf99 commented 2 years ago

Is it expected that Microsoft or Canonical should update the Ubuntu (version-less listing) item in the MS Store ? If Microsoft, then is there any road-map, estimated timeline, or needed pre-requisites that need to happen ?

NotTheDr01ds commented 2 years ago

@wolf99 Typically Canonical still considers new LTS releases to be "in development" until the .1 release. This is why do-release-upgrade won't (currently) take you from 20.04 to 22.04 unless you specify the -d (development) flag.

22.04.1 is scheduled for release on August 6th, and I would expect that we'll see them update the unversioned "Ubuntu" app package at that time, or soon after.

yeputons commented 2 years ago

For the record: the 22.04.1 release was postponed until August 11 and released, although the release page still lists it in the "Future" section, and wsl --list --online does not have Ubuntu-22.04 for me. Will see what happens next.

I personally hope it will become available by default before ~August 25 so I can update my course's curriculum by September 1.

elsaco commented 2 years ago

22.04.1 is in the msstore already:

Name               Id                    Version         Match       Source
----------------------------------------------------------------------------
Ubuntu             9PDXGNCFSCZV          Unknown                     msstore
Ubuntu 22.04.1 LTS 9PN20MSR04DW          Unknown                     msstore
yeputons commented 2 years ago

Hmm, it seems like this actually needs a PR? See https://github.com/microsoft/WSL/issues/8634 and https://github.com/microsoft/WSL/blob/66222226bd50d2780bc0c6d12e1928ebad6e5ff6/distributions/DistributionInfo.json

kangarooo commented 1 year ago

So? How to install and is fixed?

kangarooo commented 1 year ago

@danielniccoli use winget and the store ID "9PN20MSR04DW" to install, or the name "Ubuntu 22.04 LTS". It will pull the correct version.

PS C:\> winget show --name "Ubuntu 22.04 LTS"
Found Ubuntu 22.04 LTS [9PN20MSR04DW]

That previous command shows this in russian image

ghost commented 1 year ago

You can download and install the package manually: https://aka.ms/wslubuntu2204

May be some more info here: https://learn.microsoft.com/en-us/windows/wsl/install-manual

kangarooo commented 1 year ago

You can download and install the package manually: https://aka.ms/wslubuntu2204

May be some more info here: https://learn.microsoft.com/en-us/windows/wsl/install-manual

Your link Ubuntu2204-220620.AppxBundle is 22.04 or 22.04.1 ? Your link gives 1,3GB file and super slow 50kbit/s image

Store 22.04.1 gives 667,4mb and decent speed 4Mb/s image

And install is CLI gui. Nice image

ghost commented 1 year ago

The link I provided is the workaround posted above, I had to use it as our work has locked down the Microsoft Store and winget in their GPO settings, so the link was the only way I could get 22.04 version.

sujithsugadathan commented 1 year ago

why it's still not up on --online !! ??

ghost commented 1 year ago

why it's still not up on --online !! ??

Because it's Microsuck!

mattcargile commented 1 year ago

I did a wsl --install --distribution Ubuntu and it pops up an Ubuntu window for 20.04. 22.04.1 is still listed in my Start Menu. So I end up with both 20.04 and 22.04.1 installed at once. It is weird. I end up with Ubuntu.exe and Ubuntu2204.exe in my AppData\Local\Microsoft\WindowsApps as well. I end up with both of these entries in my Apps & Features even after wsl --unregister Ubuntu. And to top it all off 22.04 is installing as WSL v1 even though my default is set to version 2.

elsaco commented 1 year ago

@mattcargile wsl --install doesn't have a --distribution option, so when you run the command it executed wsl --install Ubuntu which at this time still pulls Ubuntu-20.04.

Arguments for managing Windows Subsystem for Linux:
    --install <Distro> [Options...]
        Install a Windows Subsystem for Linux distribution.
        For a list of valid distributions, use 'wsl.exe --list --online'.

        Options:
            --no-launch, -n
                Do not launch the distribution after install.

           --web-download
                Download the distribution from the internet instead of the Microsoft Store.

Also when you unregister a distro it is not being uninstalled or removed from your system.

Sample output when running your command:

PS C:\Users\elsaco> wsl --install --distribution Ubuntu
Installing: Ubuntu
[==============            25.0%                           ]
Installing: Ubuntu
Ubuntu has been installed.
Launching Ubuntu...
mattcargile commented 1 year ago

Thanks for the response, @elsaco . You must be on a different version. I see the option.

    --install [Options]
        Install additional Windows Subsystem for Linux distributions.
        For a list of valid distributions, use 'wsl --list --online'.

        Options:
            --distribution, -d [Argument]
                Downloads and installs a distribution by name.

                Arguments:
                    A valid distribution name (not case sensitive).

                Examples:
                    wsl --install -d Ubuntu
                    wsl --install --distribution Debian

Additionally, the below description from the --help suggests at least a removal of the software, though it isn't completely clear of what it does. I suppose it keeps the bare bones software and only deletes the file system.

    --unregister <Distro>
        Unregisters the distribution and deletes the root filesystem.

Even still, the install process isn't all that straightforward even still as now I have two versions of Ubuntu in my Apps & Features. My main issue was that 22.04 was installed with Version 1 of WSL. Once I did wsl --set-version Ubuntu-22.04 2 , my installs worked correctly like for oh-my-posh and go within HomeBrew.

For completeness, here is my wsl --status output.

Default Distribution: Ubuntu-22.04
Default Version: 2

Windows Subsystem for Linux was last updated on 3/28/2022
WSL automatic updates are on.

Kernel version: 5.10.102.1
elsaco commented 1 year ago

@mattcargile you're correct! I'm using latest version:

PS C:\Users\elsaco> wsl --version
WSL version: 1.0.0.0
Kernel version: 5.15.74.2
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.19045.2311
yeputons commented 1 year ago

Seems like Ubuntu 22.04 was added in January: https://github.com/microsoft/WSL/commit/efd1413b9689673f956b85c226f384b1591434cb

Not sure if it's the default for wsl --install -d Ubuntu, would anyone mind checking?

bigsk1 commented 1 year ago

I upgraded from 20.04 to 22.04 and still all references show 20.04 but in ubuntu cli it shows 22.04. So any upgrades don't update the original install................

gmsdelmundo commented 1 year ago

Seems like Ubuntu 22.04 was added in January: efd1413

Not sure if it's the default for wsl --install -d Ubuntu, would anyone mind checking?

A couple months late, but just for anyone else possibly reading this thread - running wsl --install -d Ubuntu installs Ubuntu 22.04.2 LTS.

gabrielgrant commented 12 months ago

I'm still getting 20.04:

PS C:\Users\g> wsl --list --online
The following is a list of valid distributions that can be installed.
Install using 'wsl --install -d <Distro>'.

NAME            FRIENDLY NAME
Ubuntu          Ubuntu
Debian          Debian GNU/Linux
kali-linux      Kali Linux Rolling
openSUSE-42     openSUSE Leap 42
SLES-12         SUSE Linux Enterprise Server v12
Ubuntu-16.04    Ubuntu 16.04 LTS
Ubuntu-18.04    Ubuntu 18.04 LTS
Ubuntu-20.04    Ubuntu 20.04 LTS
PS C:\Users\g> wsl --install -d Ubuntu
Downloading: Ubuntu
Installing: Ubuntu
Ubuntu has been installed.
Launching Ubuntu...
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.6 LTS
Release:        20.04
Codename:       focal

Just ran a wsl --update in case that was the problem, but it didn't seem to have any effect on this issue

yeputons commented 12 months ago

@gabrielgrant Did you already have WSL installed? I believe a bunch of my friends got Ubuntu 22.04 installed by default with no problems.

gabrielgrant commented 11 months ago

@yeputons yes, i had WSL installed (and had been using it with Ubuntu 18.04 as Ubuntu-18.04) before installing the non-version-pinned Ubuntu distribution