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:

OptionDescription
install PKGInstall a snap.
remove PKGRemove a snap.
listList installed snaps.
find TERMSearch the Snap Store.
refresh [PKG]Update a snap (or all snaps).
info PKGShow details and available channels.
--channel=CHInstall from a specific channel (stable, edge).
--classicInstall 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 code

Tips and Best Practices

  • Some developer tools need --classic confinement for full system access (editors, IDEs); the store tells you when.
  • Snaps update automatically in the background; snap refresh --list shows what is pending.
  • Choose stability with channels: --channel=stable for reliability or edge for 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