The system /snap directory

The /snap directory is, by default, where the files and folders from installed snap packages appear on your system.

It has the following structure:

/snap/bin                   - Symlinks to snap applications
/snap/<snapname>/<revision> - Mountpoint for snap content
/snap/<snapname>/current    - Symlink to current revision, if enabled

Storage space

A file manager, or the output from some storage-related commands, will show the files and directories within /snap taking up space:

$ du -hs /snap/vlc
766M    /snap/vlc

However, these files and folders are mounted from the heavily compressed data that’s stored within the original snap, located in /var/lib/snapd/snaps. These snaps take far less space on your system than their mount points imply:

$ mount | grep vlc
/var/lib/snapd/snaps/vlc_555.snap on /snap/vlc/555 type squashfs (ro,nodev,relatime,x-gdu.hide)
$ df -h 
Filesystem      Size  Used Avail Use% Mounted on
/dev/loop12     196M  196M     0 100% /snap/vlc/555
[...]

ⓘ For a detailed overview of what a snap is, see The snap format documentation.

1 Like

I would like to point out one may confuse this directory with the snap directory used in snapcraft. Tweaking the topic title might help:

  • The /snap directory (Snapd)
  • The /snap directory (Snapcraft)
1 Like

The /snap directory is an absolute path that cannot be used by snapcraft but I made it more evident what the purpose of the page is. Thank you for looking after details like that!

1 Like

Can we delete what’s inside /snap ? Because it’s using my memory and with a “df” command I can see that all the loops are full

squashfs (which these loop devices contain) does not use any memory unless you actually access the data in it (i.e. by running a program which in turn loads libraries) …

when unused, the files in /snap are just mount points and nothing in there should occupy more ram than needed for holding the directory and file structure, when you do an ls or find command on it …

as long as you do not run the snap app itself, the only resource used is the disk space in /var/lib/snapd/snaps but no CPU or any significant amount of RAM.

I found this URL in the readme file in my Ubuntu 20.04 install. I am looking for help. I sadly renamed the 3 CORE folders in my desktop and now the snap store and all applications installed through snap are not opening. I may have really screwed myself. Can anyone be kind enough to try and help please?

rewilsoniii@yahoo.com, Ocean County NJ, USA