Linux Command Reference ยท Packages and Services
Linux snap and flatpak commands
Reference for the snap and flatpak commands: install, list, update and remove sandboxed apps, channels and remotes, and how they differ from apt packages.
snap and flatpak install applications packaged in a distribution-independent format. Instead of splitting a program across shared libraries managed by the distro, each app ships its own dependencies (or a shared runtime) and runs inside a sandbox. The same package works on Ubuntu, Fedora, Arch and others.
Snap is developed by Canonical and installs from the Snap Store; it is built in on Ubuntu. Flatpak is community-driven, uses remotes (most often Flathub), and is the default on Fedora and many desktops. Both are mostly for desktop applications, though snap also packages servers and command-line tools.
sudo snap install code --classic
sudo flatpak install flathub org.gimp.GIMP
snap list
flatpak list
Try it
Neither tool is installed in the sandbox, so these examples are read-only: they parse sample snap list output and the typical naming of Flatpak application IDs.
Press Run (or Ctrl + Enter) to see the result here.
Program input ยท what you'd type while the program runs
Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.
Press Run (or Ctrl + Enter) to see the result here.
Program input ยท what you'd type while the program runs
Type the answers before you press Run, one per line. Each time the program reads a line (with read or cat), it gets the next line from this box.
Syntax
snap COMMAND [ARGS] flatpak [--user | --system] COMMAND [ARGS]
| snap command | flatpak command | Description |
|---|---|---|
snap find word |
flatpak search word |
Search the store or remotes. |
snap install name |
flatpak install remote id |
Install an app. |
snap list |
flatpak list |
Show installed apps. |
snap refresh [name] |
flatpak update |
Update apps (snap also updates automatically). |
snap remove name |
flatpak uninstall id |
Remove an app. |
snap info name |
flatpak info id |
Show details. |
snap run name |
flatpak run id |
Start an app by hand. |
snap connections name |
flatpak permissions, flatpak override |
Inspect or change sandbox permissions. |
--classic (snap) |
n/a | Install without strict confinement (needed for editors and compilers). |
--channel=track/risk (snap) |
--branch |
Choose a release channel such as latest/stable or latest/edge. |
Returns: 0 on success, non-zero if the app, remote or channel is unknown, or on permission or network errors.
Usage notes
- Updates: snaps refresh themselves several times a day; use
snap refresh --holdto delay them. Flatpak updates only when you runflatpak update(or your software center does). - System or user installs: Flatpak can install per user (
--user, no root) or system-wide. Snaps are always system-wide. - Disk usage: each snap keeps old revisions (two by default) and each app brings its runtime, so these formats use much more space than distro packages.
snap list --allshows disabled old revisions. - Start-up time: first launch of a snap can be slow because the compressed image is mounted and unpacked into a cache.
- Sandbox limits: confined apps see only what their permissions allow, so a file dialog may not show hidden files or other drives until you grant access (
flatpak override --filesystem=...). - Command-line tools from snaps are linked in
/snap/bin; make sure that directory is inPATH. - Trust: Snap Store is a single, centrally controlled store. Flatpak lets you add any remote, which is flexible but means you decide whom to trust.
- Compared with
apt: distro packages share libraries and get security fixes for the whole system at once. Snap/Flatpak apps update on their own schedule, independent of the OS.