0

I have a four year old notebook which was initially running Ubuntu 18.10 and then upgraded to each "normal" Ubuntu version every six months. Currently, it is running 22.10. When I run a snap list command, I get the following output:

Name                            Version             Rev    Tracking         Publisher   Notes
bare                            1.0                 5      latest/stable    canonical✓  base
core                            16-2.58.3           14946  latest/stable    canonical✓  core
core18                          20230320            2721   latest/stable    canonical✓  base
core20                          20230308            1852   latest/stable    canonical✓  base
core22                          20230325            607    latest/stable    canonical✓  base
firefox                         111.0.1-2           2487   latest/stable    mozilla✓    -
gnome-3-38-2004                 0+git.6f39565       137    latest/stable    canonical✓  -
gnome-42-2204                   0+git.e7d97c7       68     latest/stable    canonical✓  -
gtk-common-themes               0.1-81-g442e511     1535   latest/stable    canonical✓  -
hunspell-dictionaries-1-7-2004  1.7-20.04+pkg-6fd6  2      latest/stable    brlin       -
snap-store                      41.3-66-gfe1e325    638    latest/stable    canonical✓  -
snapd-desktop-integration       0.1                 57     latest/stable/…  canonical✓  -

Do I really need core18, gnome-3-28-2004, and any other of the above listed snaps on my system?

On a similar test system I tried:

# snap remove gnome-3-38-2004
gnome-3-38-2004 removed
# snap remove core18
core18 removed

with no warning or error message. But, after that, firefox did not start and gave me an ERROR: not connected to the gnome-3-38-2004 content interface. message.

So, I had to do snap install gnome-3-38-2004 to correct the problem.

What of the other snaps can be safely removed from my system?

FedKad
  • 9,212
  • 7
  • 40
  • 79
  • 1
    The `firefox` snap requires `core20`, `gnome-3-38-2004`, `gtk-common-themes`, and `bare` (ignoring the obvious `snapd`) ... FYI: I just looked at the manifest of a Lubuntu ISO where the only *snap* we include is `firefox` & can thus see what it also drags in due to *connections*. – guiverc Apr 05 '23 at 11:28
  • I'm certain there was a previous thread about this - I'll see if I can find it. – Artur Meinild Apr 05 '23 at 11:29
  • 1
    Does this answer your question? [How to identify snaps on my system I no longer need?](https://askubuntu.com/questions/1236140/how-to-identify-snaps-on-my-system-i-no-longer-need) – guiverc Apr 05 '23 at 11:31
  • Does this answer your question? [Is it safe to remove gnome snap packages while uninstalling snapd?](https://askubuntu.com/questions/1345156/is-it-safe-to-remove-gnome-snap-packages-while-uninstalling-snapd) and [Ubuntu Software in Ubuntu 20.04 tells me there's an update to Core 18](https://askubuntu.com/q/1258844/) – karel Apr 06 '23 at 08:28

1 Answers1

1

Thanks for the pointers in the comments.

I figured out that the output of

$ grep "default-provider:\|base:" /snap/*/*/meta/snap.yaml | awk '{print $NF}' | sort -u
bare
core20
core22
gnome-3-38-2004
gnome-42-2204
gtk-common-themes

or

$ grep "default-provider:\|base:" /snap/*/current/meta/snap.yaml | awk '{print $NF}' | sort -u
bare
core20
core22
gnome-3-38-2004
gnome-42-2204
gtk-common-themes

would list the snaps that should not be removed; in other words, the snaps that are dependencies of other snaps.

Note that, the snap system did not warn me that the gnome-3-38-2004 snap cannot or should not be removed.

FedKad
  • 9,212
  • 7
  • 40
  • 79
  • 2
    The fact that snap doesn't warn you when a needed snap is removed feels like a bug in snap, and should be reported as such. Here's the link to the bug tracker on launchpad. https://bugs.launchpad.net/snapd/+filebug – popey Apr 05 '23 at 12:05
  • 1
    You may want to refine the `/snap/*/*/meta/snap.yaml` to `/snap/*/current/meta/snap.yaml` simply because you probably don't care if an old release of an installed snap requires some other snap, but you likely do care about currently active versions. – popey Apr 05 '23 at 12:07
  • 2
    Thanks @popey for the comments. I also reported the bug: https://bugs.launchpad.net/snapd/+bug/2015348 – FedKad Apr 05 '23 at 12:10