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?
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:
Here the command to do that:
Also note that snap does not only keep removed snaps, but also up to 20 older versions of that snap (standard is 3 versions). So for me, cleaning up those remaining copies resulted in far more reclaimed storage than cleaning the cache (5GB vs 1GB). This website has a nice script which I used for that:
You can also simply do: