snap install: Usage, Options & Common CI Errors
snap install adds self-contained snap packages, mainly on Ubuntu runners.
snap installs sandboxed, self-updating packages. It works on Ubuntu VM runners but is notoriously broken inside containers, where the snapd daemon usually is not running - a frequent CI surprise.
What it does
snap install fetches a snap from the Snap Store and installs it via the snapd daemon. Snaps are confined by default; tools that need broad system access use --classic confinement. Channels (--channel) select a release track such as stable, candidate, or a specific version.
Common usage
snap install jq
snap install --classic node # classic confinement
snap install --channel=22/stable core22
snap install go --classic --channel=1.22/stableCommon errors in CI
Inside Docker containers snap typically fails with "error: cannot communicate with server: Post ... dial unix /run/snapd.socket: connect: no such file or directory" because snapd is not running - prefer apt/the vendor binary in containers, or use a full VM runner. "error: This revision of snap ... is not available on ... use --classic" means the snap needs --classic confinement. GitHub-hosted Ubuntu VM runners do support snap, but it is slower than apt and not reproducible (snaps auto-update).
Options
| Flag | What it does |
|---|---|
| --classic | Use classic (unconfined) confinement |
| --channel=<track> | Install from a specific channel/version |
| --dangerous | Install a local unsigned .snap file |
| list | List installed snaps |