Update: It looks like this script only works with English. In my case, the script reduced the size of the /var/lib/snapd/snaps/ folder by more than 50%. Using this script should free up some significant disk space (depending on the number of snap packages installed on your system, and if they had updates since they were installed). Snap remove "$snapname" -revision="$revision" LANG=en_US.UTF-8 snap list -all | awk '/disabled/' | Related, but for Flatpak packages: How To Remove Unused Flatpak Runtimes To Free Up Disk Spaceīut what if you want to remove all versions kept on the system for all snap packages that had updates? This is a script created by Popey, Community Manager in Ubuntu Engineering at Canonical, to remove ALL old versions of snaps, only keeping the current active version (updated with LANG=en_US.UTF-8 so it works with non-English locales, thanks to William in the comments): You can change this from the default value of 3 to 2 by using: There is a snap option (starting with snapd version 2.34), called refresh.retain, to set the maximum number of a snap's revisions stored by the system after the next refresh, which can be set to a number between 2 and 20. Meaning that for each installed snap package that had at least 2 updates, I had 3 revisions stored on my system, taking up quite a bit of disk space. While investigating how I could free up some space / clear the snap cache from the /var/lib/snapd/snaps/ folder without removing the snap packages I had installed, I found out that by default, 3 snap versions are stored by the system after snap package updates. I was using Disk Usage Analyzer recently to see if I could free up some space on my Ubuntu 18.10 desktop, when I noticed that the /var/lib/snapd/snaps/ folder was quite large.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |