I have noticed that a third of my root directory space is overtaken by snaps, so I thought I would like to clean the older versions. The problem seems to lie specifically within skype
and slack
snaps.
If I list the contents of /var/lib/snapd/snaps
folder, I see
-rw------- 1 root root 146771968 17. Apr 2023 skype_266.snap
-rw------- 1 root root 146771968 23. Apr 2023 skype_267.snap
-rw------- 1 root root 147140608 25. Apr 2023 skype_269.snap
-rw------- 1 root root 147464192 2. Jun 2023 skype_277.snap
-rw------- 1 root root 148238336 30. Jun 2023 skype_284.snap
-rw------- 1 root root 189390848 12. Aug 2023 skype_291.snap
-rw------- 1 root root 183984128 27. Sep 2023 skype_299.snap
-rw------- 1 root root 183963648 1. Okt 2023 skype_301.snap
-rw------- 1 root root 183963648 5. Okt 2023 skype_302.snap
-rw------- 1 root root 184414208 18. Okt 2023 skype_305.snap
-rw------- 1 root root 184414208 24. Okt 2023 skype_306.snap
-rw------- 1 root root 184573952 28. Nov 2023 skype_311.snap
-rw------- 1 root root 187752448 6. Feb 13:55 skype_326.snap
-rw------- 1 root root 186470400 21. Apr 14:28 skype_342.snap
-rw------- 1 root root 186773504 7. Mai 11:35 skype_345.snap
-rw------- 1 root root 185835520 9. Mai 12:08 skype_348.snap
-rw------- 1 root root 123162624 6. Nov 2023 slack_110.snap
-rw------- 1 root root 123101184 23. Apr 18:10 slack_142.snap
-rw------- 1 root root 123695104 4. Jun 11:01 slack_149.snap
-rw------- 1 root root 125300736 19. Jun 19:54 slack_153.snap
-rw------- 1 root root 125874176 4. Mai 2023 slack_69.snap
-rw------- 1 root root 118751232 12. Aug 2023 slack_83.snap
-rw------- 1 root root 121425920 18. Sep 2023 slack_95.snap
Namely, 16 different versions of skype and 7 versions of slack.
I thought I could use the tools provided by snap
to clean the directory. So, I have tried to impose a general limit on the number of revisions with
sudo snap set system refresh.retain=2
to no avail. I have also tried to delete older versions manually
snap remove skype --revision=n
where I substituted n>=2. In the latter case, snap
s answer was that no such revision is installed.
If I list all the snaps with snap list --all
, only two versions are listed for skype
and slack
:
skype 8.117.0.202 342 latest/stable skype✓ disabled
skype 8.119.0.201 348 latest/stable skype✓ -
slack 4.39.88 153 latest/stable slack✓ -
slack 4.38.125 149 latest/stable slack✓ disabled
So it seems that snap
simply does not see all the older versions of snaps.
How do I deal with this problem in a systematic manner? Is it safe to delete the folders in snap folder myself?