Almost all of snaps on my system which have duplicates that differ only in version number.
- Do the latest snaps depend on the earlier snaps, or is it okay to delete the earlier snaps?
- If it's okay to delete the earlier snaps, is there a command that will take care of this like
apt autocleanandapt autoremove?
Here's an example of the duplication. Some of the snaps appear to differ by major-version number; others appear to differ only by minor-version number.
wine-platform-3-stable_10.snap
wine-platform-3-stable_11.snap
wine-platform-5-stable_13.snap
wine-platform-5-stable_16.snap 1 1 Answer
You can set the maximum number of snap revisions stored for each package by setting the refresh.retain option. The refresh.retain option can only be an integer between 2 and 20 and has a default value of 3. source
It's OK to remove earlier versions of snap packages down to the minimum number of saved snap revisions of 2. The following command changes the number of saved snap revisions from the default value of 3 to 2.
sudo snap set system refresh.retain=2 2