Why are there two different flows for when ''apt install xyz'' only exists as a snap?

Ubuntu Version:
26 LTS

Desktop Environment (if applicable):
GNOME N/A

Problem Description:

If I do ‘‘sudo apt install chromium’’, my console will install the chromium snap. I know this is a controversial flow, but my understanding is Ubuntu doesn’t intend to ship a .deb package of things like chromium or firefox. Image:

But if I try this with a different piece of software, for example ‘‘sudo apt install tailscale’’ I get the following:

This is less a bug but more a question of why the privileged flow isn’t the one like tailscale. Shouldn’t prompting an apt install of something only available as a snap just inform me as such ‘‘no apt package ‘‘xyz’’ but there is a snap with that name. Try ‘‘sudo snap install tailscale’’ ‘‘ ?

I’d be curious to understand why both flows are currently found?

Cheers!

apt is a tool to manage deb packages. To manage snaps there are other tools. apt knows nothing about Chromium snap - it installs the deb package chromium-browser which performs snap installation in its pre-/post-install script.

If apt could manage snaps, no chromium-browser package were needed.

My information is that the deb or debian package of Chromium is in a Debian repository.

Debian repository for the deb package of Chromium

Debian repositories are not part of the repositories or archives of Ubuntu. The apt utility of Ubuntu only accesses repositories of Ubuntu and any third party repository specifically installed by the user.

So, the work flow that you mention is not a work flow, in my opinion, but more like a Ubuntu software engineer’s attempt to make apt error messages more informative.

A Ubuntu user who wants to install Chromium can only install it as a snap package. To my mind it makes sense to have some link that gives the user what they want by turning an apt install request into a snap install request without confusing the user. Particularly the new user whose point of view you are reasoning from.

Regards

There are only three packages (to my knowledge) that install a snap: Firefox, Chromium, and Thunderbird. The reason for this was originally to provide a transitional package to install the snap for people upgrading from an earlier version of Ubuntu. Since then, it has been discovered as this being necessary to provide some xdg handling for setting the default browser and the default mail client.

Those are the only three packages (that I know of) that, when you install the package from apt, it installs the snap.

3 Likes

It is sadly the only functional flow to make sure you keep the browser installed when you do a release to release upgrade (with do-release-upgrade) when coming from an Ubuntu release with non-snap installed browser, else that mess would not be needed :slight_smile:

Given these old LTSes will eventually go EOL this will then not be needed anymore …

1 Like

Sadly, it will still be, but might be renamed to not install the snaps. For seeding, we (flavor leads, desktop team, etc) need it to provide x-www-browser because, unfortunately, if it’s not there germinate will attempt to install the first one alphabetically from the repos to satisfy that dependency as opposed to the one it’s told to install from the seed.

Oh, right IIRC there was also something with the alternatives system, though that could perhaps be handled by snapd eventually but x-whatever-foobar is indeed a very deb specific thing snapd can not handle …

Essentially, this was a way to migrate existing .deb package installs to snap implementations? Makes more sense know. I figured there would be a reason.

Is this necessary to keep that implementation forever? In LTS 26, everyone is on Snap packages, or synced the debian package from the debian repos themselves (or another implementation).

It would just be nice to put this old issue to rest and move on once and forall.

Also, sucks that the community did not understand why this was done.

This has been explained ad-nauseum over the years but some people choose not to listen to reason and figure it’s just Canonical forcing it, when that’s certainly not the case.

But also see the discussion between myself and @ogra above as to why a package that provides x-www-browser must exist.

4 Likes