Introduction / Why This Is Needed
Snap is a software packaging and distribution system developed by Canonical. Unlike traditional package managers (APT, DNF), Snap packages include all necessary dependencies, ensuring they run on any supported Linux distribution regardless of system library versions.
What you'll get:
- A unified way to install popular software (VS Code, Firefox, Spotify) on Ubuntu, Fedora, Debian, and others.
- Automatic background application updates.
- Application isolation from the system (security).
- Access to the latest software versions that may be missing from your distribution's official repositories.
Requirements / Preparation
Before you begin, ensure:
- You have a supported Linux distribution installed (Ubuntu 16.04+, Debian 10+, Fedora 29+, Arch Linux).
- You have access to an account with sudo (administrator) privileges.
- Your system is connected to the internet to download packages.
💡 Tip: On some distributions (e.g., vanilla Debian), the
snapdpackage may be in non-official repositories. You might need to enable them first.
Step-by-Step Guide
Step 1: Install the Snap Daemon (snapd)
First, install the core snapd package, which provides the snap client and background service.
For Ubuntu/Debian:
sudo apt update
sudo apt install snapd
For Fedora/CentOS/RHEL:
sudo dnf install snapd
# For CentOS/RHEL, you may need to enable the EPEL repository
sudo dnf install epel-release
sudo dnf install snapd
For Arch Linux:
sudo pacman -S snapd
# Enable and start the service
sudo systemctl enable --now snapd.socket
# For classic confinement packages, a symlink is also needed
sudo ln -s /var/lib/snapd/snap /snap
Step 2: Check the snapd Service Status
After installation, ensure the service is running and ready.
# Check socket activity (primary method)
systemctl is-active snapd.socket
# Expected output: active
# Alternative check via snap client
snap version
# Output should show versions for snapd, snap, and the kernel series.
If the service is not active, start it:
sudo systemctl start snapd.socket
sudo systemctl enable snapd.socket # Autostart on boot
Step 3: Find the Desired Application in the Snap Store
Use snap find to search available packages. Search occurs by name, description, and publisher name.
# Search by keyword (e.g., code editor)
snap find code
# Example output:
# Name Version Publisher Summary
# code 1.85.2 vscode✓ Code editing. Redefined.
# code --classic 1.85.2 vscode✓ Code editing. Redefined (classic)
Note the ✓ flag—it indicates a package from a verified publisher (official). Avoid unverified packages from unknown sources.
Step 4: Install the Selected Snap Package
Installation is done via snap install. By default, packages install in strict confinement, providing maximum isolation.
# Basic installation
sudo snap install <package_name>
# Example: Install Firefox
sudo snap install firefox
# For applications requiring full system access (e.g., Docker, VS Code),
# use 'classic' confinement. Note this in the `snap find` output.
sudo snap install code --classic
⚠️ Important: Packages with
classicconfinement have the same permissions as regular system applications and are not isolated. Only install them from trusted sources.
Step 5: Manage Installed Snap Applications
View list of installed packages
snap list
# Output:
# Name Version Rev Tracking Publisher Notes
# code 1.85.2 234 latest/stable vscode✓ classic
# firefox 128.0.3 248 latest/stable mozilla✓
Update packages
Snap packages update automatically by default. Force update all packages:
sudo snap refresh
Update a specific package:
sudo snap refresh <package_name>
Remove a package
sudo snap remove <package_name>
# Example:
sudo snap remove code
Get package information
snap info <package_name>
# Shows: description, versions, update channels (stable/candidate/beta/edge),
# dependencies, size, and configuration.
Verification
- Ensure the Snap daemon is running:
snap version
The output should list versions forsnapd,snap, and the kernel series. - Check the installed application:
snap list | grep firefox
If the package appears in the list, installation was successful. - Launch the application:
- Via your desktop environment's application menu (GNOME, KDE).
- Or from the terminal by simply typing the package name (e.g.,
firefox). - Commands for classic confinement packages are available in the regular
PATH.
Potential Issues
"command not found: snap" after installing snapd
Cause: Package is installed, but the terminal session doesn't see the new /snap/bin path (or /usr/bin on some distributions).
Solution: Close and reopen the terminal, or run:
export PATH=$PATH:/snap/bin
For a permanent fix, add this line to ~/.bashrc or ~/.zshrc.
"snapd service not started" or "cannot communicate with server"
Cause: The snapd.socket service is not running.
Solution:
sudo systemctl start snapd.socket
sudo systemctl enable snapd.socket
Insufficient disk space
Cause: Snap packages can be large (1-2 GB) as they bundle all dependencies.
Solution:
- Clean up old package versions:
sudo snap set system refresh.retain=2 # Keep only the 2 most recent versions sudo snap refresh --amend # Apply setting to current packages - Remove unnecessary packages (
sudo snap remove <name>). - Check space:
df -h /var/lib/snapd/.
Conflict with a classic package (e.g., two Firefoxes)
Cause: You installed the Snap version of Firefox, but a version from APT/DNF already exists. They conflict on paths.
Solution: Remove the classic package:
# For Ubuntu/Debian
sudo apt remove firefox
# For Fedora
sudo dnf remove firefox
Then verify the Snap version launches. On some distributions (like Ubuntu), the Snap Firefox is the system default, and removing the APT package may happen automatically.