Snap¶
- ID
snap- Home page
- Version requirement
>= 2
- Platforms
🅱️ BSD · 🐧 Linux · ⨂ Unix
- Operations
installed·outdated·search·install·upgrade·upgrade_all·remove- purl types
pkg:snap- CLI name
snap- Every call
snap <command> --color=never- Issues and PRs
- Source
Canonical’s snap installs sandboxed, self-updating packages.
snaps refresh themselves on a schedule, so upgrade merely forces a
snap refresh sooner. Mutating operations escalate through sudo by
default: the privileged work happens in the snapd daemon, but the daemon
refuses state changes from an unprivileged client (snap install as a
plain user is denied with a hint to retry with sudo), which is why the
Snap store documents sudo snap install as the canonical invocation. A
host authenticated against the store with snap login (or granted a
polkit rule) can drop the wrap with --no-sudo or a
[mpm.managers.snap] sudo = false override.
Note
snap localizes and colorizes its table headers with no terminal
detection. mpm pins nothing to English: --color=never strips the
ANSI, the header row is dropped, and every row is split on whitespace
and read by column position, so the translated headers never reach the
parser.
Note
snap refresh --list reports only the available version, so
outdated looks each installed version up by ID from the cached
installed set. search runs snap find, which matches summaries as
well as names, so mpm refilters the results.
What mpm adds to snap¶
Through mpm, snap gains --exact and --extended search, to narrow to exact names or match descriptions.
Bigger still, mpm reaches across every manager at once: mpm installed and mpm outdated cover snap alongside every other manager you run in one table, mpm upgrade --all updates them together, and mpm sbom exports the whole machine as one bill of materials.
Every mpm command also gains --dry-run and --plan previews, cross-scheme version comparison and purl identifiers. See manager augmentations for how each one is built.
Your snap commands, in mpm¶
You already know snap: each operation maps one-to-one onto mpm, in an interface shared by every manager.
To… |
With |
With |
|---|---|---|
List what’s installed |
|
|
List outdated packages |
|
|
Search for a package |
|
|
Install a package |
|
|
Upgrade one package |
|
|
Upgrade everything |
|
|
Remove a package |
|
|
Prefix any command above with --dry-run to simulate the underlying manager calls without touching the system: the safe way to watch what mpm would do before trusting it.
Operations¶
Operation |
Supported |
Notes |
|---|---|---|
|
✓ |
|
|
✓ |
|
|
||
|
✓ |
exact and extended search backfilled by |
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
✓ |
|
|
||
|
||
|
Selecting and configuring snap¶
Deselect snap for a single run with --no-snap, or persist the choice in your configuration:
[mpm]
snap = false
The arguments and environment variables listed in the box atop this page are forced on every snap call, so runs stay quiet, non-interactive and reproducible: the defaults you would set in CI anyway.
Keep it enabled but tune how mpm drives it with a per-manager override:
[mpm.managers.snap]
timeout = 900
mpm config-template snap prints every overridable attribute as a ready-to-paste block.
Recipes¶
A few jobs you would otherwise script around snap, one mpm command each:
Snapshot and clone a machine:
mpm --snap dump snap.toml, thenmpm restore snap.tomlon the next one.Export a compliance SBOM:
mpm --snap sbom(CycloneDX by default,--spdxfor SPDX).
Privilege escalation¶
System-wide manager: mpm wraps its privileged operations in sudo out of the box. Instead of letting the tool prompt mid-run, mpm primes the credential cache up-front, with a single branded password prompt at most. Turn escalation off for rootless setups with --no-sudo or the per-manager sudo override.
See privilege escalation for the full policy.
Cooldown¶
State of Snap’s release-age gating, from the cooldown support table:
Status: ➖ N/A (risk channels
stable/candidate/beta/edge, plussnap refresh --holdup to 90 days)Mechanism:
snap refresh --holdReference: Snap docs
A cooldown only pays off where a compromised release can be withdrawn while the clock runs, and can only be emulated where the registry dates its releases. From the retraction table:
Registry: Snap Store
Retraction: Index revert on the channel pointer: “Promoting and demoting revisions is also a useful progression […] for when a snap needs to revert to an older version as a response to a security concern” (release management)
With --cooldown set, mpm skips this manager’s install and upgrade operations rather than run them unguarded (fail-closed); --allow-unsupported-managers opts back in.
Version probe¶
The version is probed by running:
$ snap --version
snap 2.44.1
snapd 2.44.1
series 16
linuxmint 19.3
kernel 4.15.0-91-generic
and extracted with:
r"snap\s+(?P<version>\S+)"
Reference traces¶
Raw native outputs captured in the manager source: the reference mpm’s parsers were written against. If you know Snap well and a transcript below looks wrong, or a newer release changed its output format, report it.
$ snap list --color=never
Name Version Rev Aufzeichnung Herausgeber Hinweise
core 16-2.44.1 8935 latest/stable canonical✓ core
wechat 2.0 7 latest/stable ubuntu-dawndiy -
pdftk 2.02-4 9 latest/stable smoser -
$ snap refresh --list --color=never
Name Version Rev Herausgeber Hinweise
standard-notes 3.3.5 8 standardnotes✓ -
Feed any of these through mpm and the raw output becomes one uniform table, the same shape for every manager: filter it, project columns, or export it (mpm --snap installed --output json, or csv, toml, yaml), each package carrying a purl and a version comparable across managers.
Changelog¶
7.5.0(2026-08-03)Fix
snap removefailing witherror: unknown flag 'color'on recent snapd by no longer appending--color=never, whichremovedoes not accept.
7.4.0(2026-07-25)Mutating operations now escalate through
sudoby default, matching each tool’s canonical invocation (sudo port install,sudo pkg install,sudo snap install): MacPorts installs root-owned under/opt/local, the FreeBSDpkgfrontend gains the markers itsportssibling already had, and snapd denies state changes from an unprivileged client. Opt out with--no-sudoor a per-managersudo = falseoverride.pkgpassesIGNORE_OSVERSIONas a command-line option now, which survives thesudoenvironment reset where the environment variable would be stripped.
6.4.0(2026-04-27)Add
removeoperation. Closes #1775.
5.5.0(2022-07-08)Fix parsing of empty search results.
4.13.1(2022-04-17)Fix command argument order. Address #579.
3.2.0(2020-05-31)Add support for
snapon Linux.