This error occurs when apt cannot find the snapd package in your configured repositories. Common on distributions where snapd is not in default repositories (Debian, Linux Mint) or when package lists are outdated. Fix by updating package lists, enabling the universe repository (Ubuntu), or removing snapd blocks (Mint).
The apt package manager searches for packages in repositories configured in your system. When you run `apt install snapd`, apt queries these repositories to locate the package. The 'Unable to locate package' error indicates that snapd is not available in any of your configured repositories. This commonly occurs because: - **On Debian**: Snapd may not be in the default stable repositories, or the system is missing backports - **On Ubuntu**: The universe repository (which contains snapd) is not enabled - **On Linux Mint**: Mint explicitly blocks snapd installation via a preference file - **Outdated package lists**: Your local package cache hasn't been refreshed to include snapd - **Different architecture**: You may be on i386 architecture where snapd is unavailable - **Old or minimal OS install**: Minimal installations may not have access to all repositories The issue is environment-specific because different distributions ship with different default repositories and some distributions actively prevent snapd installation for policy reasons.
Always start by refreshing your package lists to ensure you have the latest information about available packages:
sudo apt updateThis downloads the latest package metadata from all configured repositories. After updating, try installing again:
sudo apt install snapdIf this resolves the issue, you're done. If not, the package simply isn't in your current repositories and you'll need to enable additional repositories or check your distribution.
On Ubuntu, snapd is in the universe repository, which is not enabled by default on some installations.
Enable universe repository:
sudo add-apt-repository universe
sudo apt update
sudo apt install snapdVerify it's enabled:
# Check if universe is in your sources
cat /etc/apt/sources.list | grep universe
# Or list all enabled repositories
apt-cache policy | grep universeIf that doesn't work, enable manually:
# Edit sources.list
sudo nano /etc/apt/sources.listLook for your main Ubuntu repository line (usually deb http://archive.ubuntu.com/ubuntu/ ...) and add the universe component:
deb http://archive.ubuntu.com/ubuntu/ jammy main universe
deb-src http://archive.ubuntu.com/ubuntu/ jammy main universe
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main universe
deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main universeSave the file (Ctrl+O, Enter, Ctrl+X in nano), then:
sudo apt update
sudo apt install snapdLinux Mint intentionally blocks snapd installation. To use snapd on Mint, you must remove the preference file that blocks it.
Remove the snapd block:
sudo rm /etc/apt/preferences.d/nosnap.pref
sudo apt update
sudo apt install snapdWhy Mint blocks snapd:
Linux Mint's maintainers consider snapd to be unpolished and prefer native .deb packages. However, some applications are only available via snap (e.g., certain editors, tools).
After installation:
Start the snapd service:
sudo systemctl start snapd
sudo systemctl enable snapdNote: Removing the snapd block doesn't affect other Mint policies or updates.
On Debian, snapd may only be available in the backports repository. First, check if snapd is available in regular repositories:
apt-cache policy snapdIf it shows "Candidate: (none)" or an older version, enable backports:
For Debian 12 (Bookworm):
sudo add-apt-repository "deb http://deb.debian.org/debian bookworm-backports main"
sudo apt update
sudo apt install snapdFor Debian 11 (Bullseye):
sudo add-apt-repository "deb http://deb.debian.org/debian bullseye-backports main"
sudo apt update
sudo apt install snapdFor Debian 10 (Buster) and earlier:
Snapd may not be available at all. Check if your distribution is still supported:
lsb_release -a # Check your Debian versionIf running very old Debian (pre-9), snapd is not available. Consider upgrading your distribution or using alternative package managers.
Verify backports is enabled:
cat /etc/apt/sources.list.d/* 2>/dev/null | grep backports
grep -r "backports" /etc/apt/sources.list*If none of the above options work, verify your system setup:
1. Check your Linux distribution:
# Identify your distribution
lsb_release -a
cat /etc/os-releaseCheck if snapd is officially supported on your distribution version. Some minimal or older distributions don't support it.
2. Verify package architecture:
# Check your system architecture
uname -m
dpkg --print-architecture
# Check if snapd is available for your architecture
apt-cache search snapd | grep -i snapdSnapd is primarily available for amd64, arm64, and armhf architectures. If you're on i386 or another architecture, it may not be available.
3. Check your sources.list configuration:
cat /etc/apt/sources.list
ls -la /etc/apt/sources.list.d/Look for disabled repositories (lines starting with # ). If your only repository is commented out, enable it or add a working repository.
4. Add a repository manually:
If your distribution isn't configured correctly, add the standard repository:
# For Ubuntu-based systems
echo "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) main universe" | sudo tee -a /etc/apt/sources.list
sudo apt updateIf snapd is not available in any repository, you can install it using alternative methods.
Method A: Manual .deb installation (Ubuntu/Debian)
Download and install the package directly:
# Check available versions
apt-cache policy snapd
# If backports available, try that first
sudo apt install -t $(lsb_release -sc)-backports snapd
# Or download .deb manually from Debian/Ubuntu servers
cd /tmp
wget http://deb.debian.org/debian/pool/main/s/snapd/snapd_*_amd64.deb
sudo apt install ./snapd_*_amd64.debMethod B: Check if snap is already installed
On some systems, snap might already be present even if snapd isn't in apt:
which snap
snap versionIf snap works, you may only need the snapd daemon:
sudo apt install --no-install-recommends snapdMethod C: Use container alternative
If snapd truly cannot be installed, some snap applications have Docker images or native packages available:
# Example: Use docker instead of snap for certain tools
docker run --rm ubuntu:latest snap install <package>Warning: Installing from outside repositories means missing security updates. This is only recommended as a last resort.
After successfully installing snapd, verify it works and fix any PATH issues:
Start the snapd service:
sudo systemctl start snapd
sudo systemctl enable snapdVerify installation:
snap version
snap listFix PATH if needed:
If snap commands don't work after installation, add snap to your PATH:
echo "export PATH=$PATH:/snap/bin" >> ~/.bashrc
source ~/.bashrcTest snap is working:
# Install a test package
snap install hello-world
# Run it
hello-worldTroubleshoot snap issues:
If snap is installed but applications don't appear:
# Check snap daemon status
sudo systemctl status snapd
# Restart snapd if needed
sudo systemctl restart snapd
# Check snap logs
sudo journalctl -u snapd -n 20
# List installed snaps
snap list
# Refresh all snaps
snap refresh### Why Different Distributions Handle Snapd Differently
Ubuntu: Canonical created snapd and ships it by default in modern Ubuntu versions. The universe repository is a standard Ubuntu repository for community-maintained software.
Debian: The Debian community is more conservative about packaging technology. Snapd is available but not in main repositories - it's in backports and testing branches. Debian's philosophy emphasizes stability and native packages.
Linux Mint: Mint's maintainers have publicly stated concerns about snapd's design (confined vs. unconfined confinement, sandboxing issues). They prefer traditional .deb packages and provide a strong recommendation against using snap. However, they allow users to override this policy.
Other distributions: Alpine, Arch, openSUSE and others have their own package managers and policies around snapd.
### Understanding apt Repository Hierarchies
Ubuntu repositories typically include:
- main: Canonical-supported, free software
- universe: Community-maintained, free software
- restricted: Non-free proprietary software with Canonical support
- multiverse: Non-free, unsupported by Canonical
Snapd usually lives in universe because it's maintained by the community (though created by Canonical).
Debian's repository hierarchy is simpler:
- main: DFSG-compliant packages
- contrib: Packages that depend on non-free software
- non-free: Non-free packages
Snapd doesn't fit cleanly into this hierarchy, hence why it went to backports.
### Debugging Repository Issues
If you're consistently unable to find packages:
# List all sources apt will check
apt-cache policy
# See which source provides a package
apt-cache search snapd
apt-cache show snapd | head -20
# Check your sources.list and sources.list.d
cat /etc/apt/sources.list
ls -la /etc/apt/sources.list.d/
# Verify repository keys are trusted
sudo apt-key list | head
# Re-add GPG keys if needed
wget -qO - https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x1234567890ABCDEF | sudo apt-key add -### Repository Configuration for Minimal Systems
If you're setting up a minimal system from scratch:
# Ubuntu: ensure all standard repositories
sudo apt-add-repository main
sudo apt-add-repository universe
sudo apt-add-repository restricted
sudo apt-add-repository multiverse
sudo apt update
# Debian: enable backports
sudo add-apt-repository "deb http://deb.debian.org/debian $(lsb_release -sc)-backports main"
sudo apt update### Snap vs. Other Package Managers
If snapd truly cannot be installed and you need the application:
- apt/dpkg: Native packages (preferred when available)
- snap: Universal Linux packages (requires snapd)
- flatpak: Similar to snap, uses different confinement model
- AppImage: Single executable, no package manager needed
- Source compilation: Download and build from source
- Docker: Run application in container
Each has tradeoffs in security, convenience, and disk space.
### Reporting Repository Issues
If you believe a repository is misconfigured or missing packages:
# Report to your distribution's support
ubuntu-bug apt # Ubuntu
reportbug apt # Debian
# For Mint
sudo mintstick # Mint tools
# Check distribution-specific support channelsE: Could not connect to proxy server
Could not connect to proxy server
E: Package 'package:i386' has no installation candidate
How to fix "Package package:i386 has no installation candidate" in apt
E: The value 'value' is invalid for APT::Default-Release
How to fix invalid APT::Default-Release value in APT
dpkg: error: unable to create new file 'path': Permission denied
How to fix dpkg permission denied errors in APT
subprocess installed post-removal script returned error exit status 1
How to fix "subprocess installed post-removal script returned error exit status 1" in APT