Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

snap Command Guide for Cross-Distro Packaging

The universal package format: one command installs the same app on any distro, with automatic updates.

snap packages applications as snaps — containerized bundles that carry their own dependencies and run in isolation. Unlike distro-native managers such as apt or dnf, a snap works the same way everywhere: the same Spotify or VS Code install on Ubuntu, Fedora, or Arch. If a program ships a snap, that is usually the fastest way to get its latest version without touching your system packages.

What is snap, and Why Use It?

  • One format, every distro — the same snap installs on Ubuntu, Debian, Fedora, Arch, and more; no per-distro packaging work.
  • Always current — snaps update automatically in the background, so you get new features and security fixes without waiting for your distro’s release cycle.
  • Isolated by default — each snap runs in its own sandbox with confined access, so a broken or malicious snap cannot freely touch the rest of the system.
  • Coexists with your distro — snaps live beside apt/dnf/pacman; system packages keep doing system work while snaps handle apps.

A snap is the difference between “your distro packages this app in version 2.1” and “the developer ships version 4.0 today, on every Linux” — the app travels with its own dependencies.


1. Installing snapd

Most Ubuntu-family systems already have snapd (the daemon and CLI) installed. On other distros, install it once:

# Debian/Ubuntu (usually preinstalled)
sudo apt install snapd

# Fedora
sudo dnf install snapd

# Arch
sudo pacman -S snapd

Then enable the socket and (on systemd distros) restart the daemon:

sudo systemctl enable --now snapd.apparmor 2>/dev/null || true
sudo systemctl restart snapd 2>/dev/null || true

Verify with snap version — if it prints a version number, you are ready.


2. Searching and Finding Snaps

# Search the snap store by keyword
snap find code

# Show details about one snap (version, publisher, permissions)
snap info code

snap find searches the central store; snap info is where you check the publisher (prefer official publishers like code from Microsoft over community re-uploads) and the snap’s confinement level.


3. Installing a Snap

# Install Visual Studio Code
sudo snap install code

# Install a specific version or channel
sudo snap install spotify --classic

Two things to know:

  • --classic grants the snap full access to the system (traditional, unconfined behavior). Needed by tools that expect to run like ordinary programs — IDEs, some node packages. Use it only when the snap’s own page says so.
  • Channels (--edge, --beta, --candidate) let you opt into pre-release updates; the default is stable.

Snaps appear in your application menu automatically.


4. Managing Installed Snaps

# List installed snaps
snap list

# Update everything (or one snap)
sudo snap refresh
sudo snap refresh code

# Remove a snap (its data may remain; add --purge to remove it too)
sudo snap remove code

Updates are also automatic — snap refresh just makes it on-demand. To see what changed recently: snap changes.


5. Common Pitfalls

  • Forgetting sudo — installing, refreshing, and removing snaps are system operations; without sudo they fail with permission errors.
  • Assuming every app is a snap — the store is large but not complete; if snap find returns nothing, the app may exist only as a distro package, a flatpak, or a tarball.
  • Confusing snaps with system packages — a snap of firefox is not the distro’s firefox; the two can be installed side by side and behave differently.
  • Blanket --classic — classic confinement disables the sandbox; reach for it only when a snap genuinely needs it, and prefer confined snaps otherwise.
  • Snap daemon surprises — on minimal or container systems, snapd may need enabling before snap commands work at all (section 1).

PageWhy You’ll Open It
Package ManagementHow snap fits beside the distro’s own package manager.
aptUbuntu/Debian’s manager — snaps complement it, not replace it.
dnfFedora/RHEL’s manager; snapd installs cleanly alongside it.
flatpakThe other cross-distro app format — same idea, different packaging.
sudoRequired for installing and refreshing snaps system-wide.

snap Cheatsheet

CommandWhat It Does
sudo apt install snapdInstall the snap daemon (Debian/Ubuntu).
snap versionVerify snapd is installed and running.
snap find editorSearch the snap store by keyword.
snap info codeShow a snap’s version, publisher, and permissions.
sudo snap install codeInstall a snap.
sudo snap install spotify --classicInstall an unconfined (classic) snap.
snap listList installed snaps.
sudo snap refreshUpdate all snaps.
sudo snap refresh codeUpdate one snap.
sudo snap remove codeRemove a snap.
snap changesShow recent snap operations and their status.