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:
--classicgrants 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 isstable.
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; withoutsudothey fail with permission errors. - Assuming every app is a snap — the store is large but not complete; if
snap findreturns nothing, the app may exist only as a distro package, a flatpak, or a tarball. - Confusing snaps with system packages — a snap of
firefoxis not the distro’sfirefox; 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,
snapdmay need enabling beforesnapcommands work at all (section 1).
Related Pages
| Page | Why You’ll Open It |
|---|---|
| Package Management | How snap fits beside the distro’s own package manager. |
| apt | Ubuntu/Debian’s manager — snaps complement it, not replace it. |
| dnf | Fedora/RHEL’s manager; snapd installs cleanly alongside it. |
| flatpak | The other cross-distro app format — same idea, different packaging. |
| sudo | Required for installing and refreshing snaps system-wide. |
snap Cheatsheet
| Command | What It Does |
|---|---|
sudo apt install snapd | Install the snap daemon (Debian/Ubuntu). |
snap version | Verify snapd is installed and running. |
snap find editor | Search the snap store by keyword. |
snap info code | Show a snap’s version, publisher, and permissions. |
sudo snap install code | Install a snap. |
sudo snap install spotify --classic | Install an unconfined (classic) snap. |
snap list | List installed snaps. |
sudo snap refresh | Update all snaps. |
sudo snap refresh code | Update one snap. |
sudo snap remove code | Remove a snap. |
snap changes | Show recent snap operations and their status. |