Ubuntu – How to manage how many revisions snapd keeps of an application

package-managementsnap

So I installed vlc daily built snap package.

It's working great, no problems there. However I noticed that after upgrade the system has 2 versions of vlc (7 and 9). That can be seen when browsing /snap/vlc/ directory and using system monitor.

This is also the case with other snaps. Is there a way to automatically delete older versions of snaps? Or do I just delete them using plain "rm" command? Is it safe to delete them that way?

Best Answer

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.