Snap Package Manager Plugin
Snap Package Manager Plugin
The package_manager_snap plugin tracks and updates Snap packages on
Linux systems managed by snapd. Snap is a universal Linux package format developed by Canonical
and widely used on Ubuntu and other distributions.
What it tracks
The Snap plugin manages packages installed via the snap command. It:
- Detects the installed version of a Snap package on the managed host.
- Fetches the latest version available on a configured channel from
snapcraft.iousingsnap info. - Executes updates via
snap refresh(channel-based, not version-pinned). - Discovers all user-installed Snap packages on the host automatically.
Requirements
snapdmust be installed and running on the host.- The
snapcommand must be available onPATH. - The agent service account must have passwordless
sudoaccess to runsnap(configured automatically byuptrakit-agent bootstrap).
Configuration fields
| Field | Required | Description |
|---|---|---|
channel | No | Snap channel to track for this plugin config (e.g. latest/stable, 1.0/stable, edge). Defaults to latest/stable when not specified. |
Channel format
A Snap channel has the form <track>/<risk> or a bare <risk>:
- Track: optional version track (e.g.
latest,1.0,2024.01). Tracks let software publishers maintain multiple release streams. - Risk: one of
stable,candidate,beta, oredge.
| Channel | Meaning |
|---|---|
latest/stable | Stable releases on the default track (default) |
latest/edge | Bleeding-edge builds on the default track |
1.0/stable | Stable releases on the 1.0 track |
stable | Bare risk — equivalent to latest/stable in Snap semantics |
edge | Bare risk — equivalent to latest/edge in Snap semantics |
Channels ending in /beta or /edge are marked as pre-releases in Uptrakit.
Package identifier format
The package_identifier for a Snap-tracked package is the Snap name — the same name used
with snap install. Snap names follow strict naming rules:
- 2 to 40 characters long.
- Lowercase letters (
a–z), digits (0–9), and hyphens (-) only. - Must start and end with a letter or digit (not a hyphen).
- No consecutive hyphens (
--).
Examples of valid Snap identifiers: vlc, code, firefox, hello-world, 1password.
Autodiscovery
The Snap plugin supports autodiscovery. When the discovery scanner runs on a host with snap
installed, it calls snap list and reports all installed user snaps. For each discovered snap,
Uptrakit can automatically create:
- A software item named after the Snap package.
- A
package_manager_snapplugin config (channel: null, effective channellatest/stable). - Role assignments for
detect_version,fetch_releases, andexecute_update.
System snaps excluded from discovery
The following infrastructure snaps are filtered out automatically and will not appear as discovered software items:
core,core18,core20,core22,core24,core26— base runtime snaps.snapd— the Snap daemon itself.bare— an empty base snap used internally.
Sudo requirement
Snap package installation and refresh require root privileges. Uptrakit uses a minimal sudoers
entry generated by uptrakit-agent bootstrap:
uptrakit-agent ALL=(root) NOPASSWD: /usr/bin/snap
This allows snap refresh (updates) to run without a password. The snap list and snap info
commands used for version detection and release fetching do not require sudo.
See the Security documentation for details on how Uptrakit generates minimal sudoers entries.
Limitations
- Channel-based updates only. Snap does not support installing a specific version by string
(
snap refresh --revisionis possible but not exposed). Theexecute_updateoperation usessnap refresh <name>(optionally--channel=<channel>). The target version shown in the UI is informational only. - No package index refresh step.
snapdmanages its own metadata cache automatically; there is no equivalent ofapt updatethat needs to run before checking for updates. ↑channel entries ignored. Whensnap inforeports a channel as↑(meaning the same version as the channel above), Uptrakit skips that entry rather than resolving it upward. If your configured channel shows↑insnap infooutput, the release query will return no results — switch to the canonical channel that holds the version.- Published date is date-only. Snap info output provides only a date (
YYYY-MM-DD), not a full timestamp. Uptrakit stores the release date as midnight UTC on that date.