Quick take: The snap command manages Snap packages — self-contained apps that bundle their dependencies. Use sudo snap install name, snap list to see installed snaps, and sudo snap refresh to update them.
Introduction
Snaps are a packaging format from Canonical that bundle an application with its dependencies, run sandboxed, and update automatically. The snap command manages them on Ubuntu and other distributions. Snaps coexist with apt packages and are common for desktop apps and some server software.
Syntax
The basic syntax of the snap command is:
snap [OPTIONS] COMMAND [PACKAGE]Common Options and Parameters
The most useful options and parameters for the snap command:
| Option | Description |
|---|---|
| install PKG | Install a snap. |
| remove PKG | Remove a snap. |
| list | List installed snaps. |
| find TERM | Search the Snap Store. |
| refresh [PKG] | Update a snap (or all snaps). |
| info PKG | Show details and available channels. |
| --channel=CH | Install from a specific channel (stable, edge). |
| --classic | Install with classic confinement (full system access). |
Practical Examples
Real snap commands you can run today:
# Install a snap
sudo snap install code --classic
# List installed snaps
snap list
# Search the store
snap find 'video editor'
# Update all snaps
sudo snap refresh
# Show channels for a snap
snap info node
# Remove a snap
sudo snap remove codeTips and Best Practices
- Some developer tools need
--classicconfinement for full system access (editors, IDEs); the store tells you when. - Snaps update automatically in the background;
snap refresh --listshows what is pending. - Choose stability with channels:
--channel=stablefor reliability oredgefor the latest builds.
Final Thoughts
snap manages self-contained, auto-updating application packages that run sandboxed and bundle their dependencies. Learn install, list, refresh, and channels, and remember --classic for tools needing full access. Snaps complement apt rather than replace it — apt for system packages, snaps often for desktop and cross-distro apps.
FAQ: snap Command in Linux
How do I install a snap package?+
Use sudo snap install packagename. Some apps need sudo snap install name --classic for full system access. Search first with snap find term.
What is the difference between snap and apt?+
apt installs packages from the distribution's repositories that share system libraries. Snaps bundle their own dependencies, run sandboxed, and update automatically — useful for newer apps and cross-distribution software.
How do I list installed snaps?+
Run snap list to see all installed snaps with their versions and channels. snap list --all also shows disabled older revisions.
How do I update snaps?+
Use sudo snap refresh to update everything, or sudo snap refresh name for one. Snaps also auto-update in the background by default.
How do I remove a snap?+
Run sudo snap remove packagename. Add --purge to also delete its data, since snap normally keeps a snapshot of removed app data.
Need help with Linux servers or infrastructure?
Work directly with Muhammad Irfan Aslam for Linux, Ubuntu, Docker, DevOps, cloud, CI/CD, or infrastructure support.
Hire Me for Support