Introduction
A .snap file is a package for Snap,
Canonical’s system for distributing Linux applications with the libraries they need.
Snaps are installed and kept up to date by the snapd service, usually
from the Snap Store, and run confined, with access to the rest of the system only
through declared interfaces. Snap is built into Ubuntu and can be added to many other
distributions.
Structure
A snap is a SquashFS filesystem image, so it starts with the SquashFS magic
hsqs (68 73 71 73). It is not unpacked when installed: snapd
mounts it read-only, and each revision stays a separate image so an update can be rolled
back. Inside, meta/snap.yaml gives the snap’s name, version, the commands
it provides and the interfaces it uses; the rest of the image holds the application’s
files. The meta/ folder and every documented snap.yaml key
are on the meta/snap.yaml page.
Not described
Known, not yet covered
- Reference: plugs and slots, hooks, layouts, confinement, grade and the SquashFS parameters, in the snapcraft documentation; see snap.yaml.
- Viewer: there is no viewer for snap packages yet.
Links
Software
- snapd – the Snap service, with the
snapcommand, which installs and runs snaps (Linux) - Snapcraft – Canonical’s tool that builds snaps (Linux)
- unsquashfs – part of squashfs-tools; extracts the files from a snap (Linux)
Reference
- Snap documentation – Canonical’s guides to using and building snaps