Score:0

Removing old (and unneeded) snaps

cn flag

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?

guiverc avatar
cn flag
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*.
Artur Meinild avatar
vn flag
I'm certain there was a previous thread about this - I'll see if I can find it.
guiverc avatar
cn flag
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)
karel avatar
sa flag
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/)
Score:1
cn flag

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.

pl flag
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
pl flag
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.
FedKad avatar
cn flag
Thanks @popey for the comments. I also reported the bug: https://bugs.launchpad.net/snapd/+bug/2015348
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.