uptrakit

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.io using snap info.
  • Executes updates via snap refresh (channel-based, not version-pinned).
  • Discovers all user-installed Snap packages on the host automatically.

Requirements

  • snapd must be installed and running on the host.
  • The snap command must be available on PATH.
  • The agent service account must have passwordless sudo access to run snap (configured automatically by uptrakit-agent bootstrap).

Configuration fields

FieldRequiredDescription
channelNoSnap 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, or edge.
ChannelMeaning
latest/stableStable releases on the default track (default)
latest/edgeBleeding-edge builds on the default track
1.0/stableStable releases on the 1.0 track
stableBare risk — equivalent to latest/stable in Snap semantics
edgeBare 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 (az), digits (09), 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_snap plugin config (channel: null, effective channel latest/stable).
  • Role assignments for detect_version, fetch_releases, and execute_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 --revision is possible but not exposed). The execute_update operation uses snap refresh <name> (optionally --channel=<channel>). The target version shown in the UI is informational only.
  • No package index refresh step. snapd manages its own metadata cache automatically; there is no equivalent of apt update that needs to run before checking for updates.
  • channel entries ignored. When snap info reports 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 in snap info output, 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.