Keep only the latest version of specific snap


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                           53    stable     snapcrafters  classic
android-studio                           51    stable     snapcrafters  disabled,classic
android-studio                           47    stable     snapcrafters  disabled,classic


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.


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

$ snap remove android-studio --revision=53