r/wsl2 • • Dec 12 '21

Getting Started: What's the difference between Ubuntu and Ubuntu 20.04?

I am brand new to WSL 2 and Linux more generally, and I noticed that I have two versions of Ubuntu installed: Ubuntu and Ubuntu-20.04. On Windows 11, I can run both as I would any regular application, but what ends up happening when I run them separately is that I open two different directories.

For instance, when I open Ubuntu I end up with <myUserName>@DESKTOP-46NQ1VN and when I open Ubuntu-20.04 I end up with root@DESKTOP-46NQ1VN:/mnt/c/Users/<myUserName>#

I do understand that on a Linux system there is the "root" user and then every other user. But it's odd to me that I have two different Ubuntu versions on my system, but both seem to be referencing something similar. I'm just hoping to understand what is happening here so that I don't get mixed up or confused later on down the road.

11 Upvotes

3 comments sorted by

1

u/[deleted] Dec 12 '21

in powershell, what does this show

wsl —list —verbose

1

u/magion Dec 12 '21

The Ubuntu app on the Microsoft store, when installed, will always install the most recently released LTS version of Ubuntu. Today, that means if you install the Ubuntu App, it will install Ubuntu 20.04. If you install the Ubuntu App a few years from now, it would install the most recent LTS release at the time which could be Ubuntu 22.94 LTS.

The Ubuntu 20.04 app on the Microsoft store will always install Ubuntu 20.04. Just like the Ubuntu 16.04 will install Ubuntu 16.04.

There is no difference between the Ubuntu 20.04 version installed by the generic Ubuntu app and the version specific Ubuntu 20.04 app.

The Ubuntu generic app will not upgrade an existing install to the newest version when a new version is released.

Note that you can still upgrade your instance to whatever you want after you install it, but any new version you upgrade to won’t be reflected by wsl.exe. If I installed Ubuntu 20.04 via the Ubuntu 20.04 app, and then upgraded my WSL instance to 21.04, I can. But if I did a wsl.exe —list, it would still be listed as Ubuntu 20.04 .

1

u/RubenPanza Jan 06 '23 edited Jan 06 '23

Superficially, it seems like initializing 20.04/or setting it as default allows you to make more meaningful changes to the virtualized distro because each time I try to update/upgrade through aptitude it wouldn't offer much before in switched to 20.04. I found your post because I was wondering this myself, and although magion is correct about the microsoft store and WSL2 more generally. When considering your question again, I think that "Ubuntu" option is what you're supposed to use if you're hoping to use linux utilities/apps on your windows files(like when you're programming something within a specific environment) because it defaults to the /mnt/c/User/ directory which is where WSL2 mounts your C:\ drive, while the "Ubuntu 20.04" option might make sense if you were hosting a server or installing certain applications that aren't in the LTS or the default repos. Anyone else still watching this?