Keep only the latest version of specific snap


#1

Snaps are eating 3 Gb and I suspect that Android Studio is responsible. snapd keeps 3 last versions of every snap by default. Is it possible to tell it to keep only 1 for this specific snap?

$ snap list --all
Name                  Version                           Rev   Tracking   Publisher     Notes
android-studio        3.1.4.0                           53    stable     snapcrafters  classic
android-studio        3.1.3.0                           51    stable     snapcrafters  disabled,classic
android-studio        3.1.2.0                           47    stable     snapcrafters  disabled,classic

#2

Snaps have automated/manual roll-back support (see snap revert) and also update through binary deltas. Both requires that you always have at least two versions on disk.

There have been discussions in the past to allow configuration to limit the on-disk install to two versions, but i do not know where that stands.


#3

For now, I am removing snaps files manually after inspecting with snap list --all:

$ snap remove android-studio --revision=53