How do I manage how many revisions snapd keeps of an application?

Solution 1:

Snapd will automatically retain three revisions (usually current plus two older) by default, and will delete older.

In mid-2018, snapd was updated so that the number of revisions is configurable (though never less than 2).

Use the command:

snap set system refresh.retain=N

N cannot be less than two.

Solution 2:

In speaking with Ubuntu developers, the current default is to keep three prior versions of a snap so that you can roll-back to a prior version if needed. This default setting is not configurable.

You can use the command snap remove --revision=<an old one> snapname to remove an older revision of a snap.

They are considering whether to have only the current snap mounted as a loop filesystem, but I don't know the status of that.