Single snap installed and 6 snaps installed automatically. Why?

On Ubuntu 22.10 I have installed most of my applications as deb packages or flatpak packages, but I would like to follow snap development, so I decided to leave one snap package (firefox) installed as snap and removed all others. Bellow whole procedure.

I’ve uninstalled all of the snaps by listing them all and removing one by one:

sudo snap list
sudo snap <snap_name> remove

I’ve checked if there is some left:

sudo snap list

And got: No snaps are installed yet. Try ‘snap install hello-world’.

Then I have installed Firefox.

sudo snap install firefox

After install I have listed snaps:

snap list

and I have got this pretty long snap list:

Name               Version          Rev    Tracking       Publisher   Notes
bare               1.0              5      latest/stable  canonical✓  base
core20             20221123         1738   latest/stable  canonical✓  base
firefox            107.0.1-1        2154   latest/stable  mozilla✓    -
gnome-3-38-2004    0+git.6f39565    119    latest/stable  canonical✓  -
gtk-common-themes  0.1-81-g442e511  1535   latest/stable  canonical✓  -
snapd              2.57.6           17883  latest/stable  canonical✓  snapd

Why are all those snaps required to have only Firefox installed as snap package?

While snaps commonly bundle all their dependencies, this is not entirely feasible for large ones. Firefox does consume a few other snaps via the “content” interface, and for these, it declares default providers; that is, snaps that it believes will provide what it needs and are installed if not present so Firefox can leverage their existing content. Example:

gnome-3-38-2004:
    interface: content
    target: $SNAP/gnome-platform
    default-provider: gnome-3-38-2004

That is where gnome-3-38-2004 comes from.

So:

  • gnome-3-38-2004 provides the gnome platform libraries.
  • gtk-common-themes provides gtk themes (really :slight_smile: )
  • core20 contains the system dependencies (basically all snaps depend on a base snap, it’s like the root filesystem that contains essential files; in Firefox’s case that base snap is core20).
  • snapd is always required and installed by the system when you install any other snap; it’s the client that allows performing snap operations.
  • bare is required by gtk-common-themes as a base. I mentioned earlier that all snaps depend on a base snap; for functional snaps, the base snap is a root filesystem, but for snaps that only provide content and no binaries such as gtk-common-themes, the base snap can be bare, which is basically an empty snap.

Cheers,

  • Daniel
3 Likes