The system /snap directory


#1

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 how snaps are constructed, see The snap format documentation.


Snap Documentation
Space used by the VLC snap
#2

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)

#3

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!