snap remove A B C: cannot remove "A", "B", "C": snap "A" is not removable: snap is being used by snaps B and C.
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Triaged
|
Undecided
|
Unassigned |
Bug Description
After removing some old snap apps that were based on core18, I wanted to clean up some unused middleware and core snaps using "snap remove" to save disk space and bandwidth.
I start out with this list of installed snaps (that application that depended on core18 has already been removed at this point):
% snap list
Name Version Rev Tracking Publisher Notes
bare 1.0 5 latest/stable canonical✓ base
core18 20231027 2812 latest/stable canonical✓ base
core20 20231123 2105 latest/stable canonical✓ base
core22 20231123 1033 latest/stable canonical✓ base
firefox 120.0.1-1 3504 latest/stable mozilla✓ -
firmware-updater 0+git.e8771be 109 latest/stable/… canonical✓ -
gnome-3-28-1804 3.28.0-
gnome-3-34-1804 0+git.3556cb3 93 latest/stable canonical✓ -
gnome-3-38-2004 0+git.efb213a 143 latest/stable canonical✓ -
gnome-42-2204 0+git.ff35a85 141 latest/stable canonical✓ -
gtk-common-themes 0.1-81-g442e511 1535 latest/stable canonical✓ -
snapd 2.60.4 20290 latest/stable canonical✓ snapd
snapd-desktop-
First, trying to simply remove core18:
% sudo snap remove core18
error: cannot remove "core18": snap "core18" is not removable: snap is being used by snaps
Ok, that makes sense. These two snaps depend on core18.
So I try again, extending my request to remove all three packages:
% sudo snap remove core18 gnome-3-28-1804 gnome-3-34-1804
error: cannot remove "core18", "gnome-3-28-1804", "gnome-3-34-1804": snap "core18" is not
removable: snap is being used by snaps gnome-3-28-1804 and gnome-3-34-1804.
Bummer.
What does work, however, is manually figuring out the dependency ordering and working my way up from the leaf nodes to the root of the dependency tree that I want to remove:
% sudo snap remove gnome-3-28-1804 gnome-3-34-1804
gnome-3-28-1804 removed
gnome-3-34-1804 removed
Followed by:
% sudo snap remove core18
core18 removed
Versions reported by "snap version":
snap 2.60.4+23.10.1
snapd 2.60.4+23.10.1
series 16
ubuntu 23.10
kernel 6.5.0-13-generic
Hi Thomas, thanks for raising this.
In this case, core18 is not a typical snap, it is a base snap! So gnomes snaps depend on core18. For removing core18, by design, you need to remove first all the snaps depending on this and then you are able to remove it.
To see which snaps are base snaps, you can see the last column in the `snap list` output