When I install a snap with snap install <SNAPNAME> then it is being downloaded and mounted. When I remove it with snap remove <SNAPNAME> then 'everything' is being deleted like the snap, user settings dependecies and so on. But when I re-install the snap after removing it, it has no download time so the snap must be stored somewhere. How can I clear the cache of snapd with all uninstalled snaps

  • They are kept in /var/lib/snapd/cache though not with snap names. You may be able to make an educated guess thru the properties of the file, i.e size and date created. Otherwise you's need to have folder open when installing a snap, see what file is created & note it's name or partial name & size in a file elsewhere for future use.. – doug Sep 13 '18 at 21:40
  • @doug That's true, I could observe that the hardlink-count changes for a certain file when installing and removing a snap repeatedly. Installing creates a hardlink in /var/lib/snad/snaps to one of the files in /var/lib/snapd/cache, same inode. Removing the file in /var/lib/snapd/cache results in a fresh download when attempting to install again. – mook765 Sep 13 '18 at 23:26

You can remove the files in /var/lib/snapd/cache without issue. Also there is no need to stop snapd before.

This was answered in Snapcraft forum:

The answers boil down to: you should not have a lot of files with hardlink count 1; at most 5 in the default install. If you have more than that, it’s a bug, please let us know.

And yes you can remove them without issue; no need to stop snapd.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.