How to remove uninstalled snaps from cache?
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.
Here the command to do that:
sudo rm /var/lib/snapd/cache/*
You can also simply do:
sudo snap remove --purge $PACKAGE