The Short Answer
apt installs .deb packages that your distribution builds and tests for its release; they share system libraries and change only when you update. A snap is a self-contained package published by the software's developer through the Snap Store; it carries its own libraries, runs confined, and refreshes itself in the background.
How Each One Works
- apt: downloads packages from the distribution's repositories, installs their files across the system, such as
/usr/binand/etc, and uses the libraries already installed. Versions stay fixed for the life of the release, apart from security and bug fixes. - snap: the
snapddaemon downloads a compressed, read-only image and mounts it under/snap. The developer picks the version for each channel, such asstableoredge, and snapd follows the channel you chose.
Side by Side
| apt (deb) | snap | |
|---|---|---|
| Built by | The distribution | The developer |
| Libraries | Shared | Bundled |
| Updates | When apt runs | Automatic |
| Versions | Fixed per release | Per channel |
| Isolation | None by default | Confinement |
| Disk use | Smaller | Larger |
Where Each Is Available
Ubuntu Server installs snapd by default, next to apt. Debian does not: apt is its only package tool until you run sudo apt install snapd. On AlmaLinux and Rocky Linux, snapd comes from the EPEL repository. apt itself exists only on the Debian family; see apt vs apt-get for its two front ends.
Everyday Commands
| Task | apt | snap |
|---|---|---|
| List installed | apt list --installed | snap list |
| Search | apt search name | snap find name |
| Details | apt show name | snap info name |
| Install | sudo apt install name | sudo snap install name |
| Update | sudo apt upgrade | sudo snap refresh |
| Remove | sudo apt remove name | sudo snap remove name |
Automatic Refresh and How to Hold It
snapd checks for new revisions several times a day and installs them by itself, restarting the snap's services. On a server you may want to choose when that happens:
snap refresh --time
sudo snap set system refresh.timer=sun,03:00-05:00
sudo snap refresh --hold=72h certbot
snap changes
The first line shows the schedule, the second moves refreshes to a Sunday night window, the third holds one snap for three days, and the last lists recent changes. If a refresh breaks something, sudo snap revert with the snap's name returns to the previous revision. apt packages change only when you or a timer run apt; see sudo apt update and automatic security updates.
Confinement
Most snaps use strict confinement: they can reach only their own data and the system resources granted to them through interfaces, which snap connections lists. A strictly confined snap may be unable to read files in other directories. Snaps marked classic in the Notes column of snap list run without confinement, like a normal package.
Disk Use and Loop Devices
Each installed snap revision is a file under /var/lib/snapd/snaps, mounted through a loop device. That is why lsblk on Ubuntu shows entries named loop0, loop1, and so on: they are snaps, not disks. snapd also keeps older revisions so it can revert. To see them and remove one you no longer need:
snap list --all
sudo snap remove certbot --revision=REVISION_NUMBER
Rows marked disabled are old revisions. Reading the real disks is covered in how to list disks in Linux.
Server Tools Often Installed as Snaps
On Ubuntu, LXD and MicroK8s are distributed as snaps, and the Certbot project recommends its snap for most users. Certbot is also available as an apt package on Debian and Ubuntu; either way works with Certbot for Nginx. Install a tool one way only, and remove the apt copy before you install the snap: two copies give you two binaries in different paths and two renewal schedules.
Choosing on a Server
- Use apt for the parts of the system itself: web server, database, PHP, and everything your distribution's security team patches.
- Use a snap when the developer publishes it as the main way to install, or when you need a newer version than your release has and accept automatic refreshes.
- Set a refresh window for snaps that run a service.
- Before removing snapd: check
snap listfirst, because removing snapd also removes every snap on the server.