apt says snapd has no installation candidate
E: Package 'snapd' has no installation candidateShort answer
apt only offers a package that its lists and pinning rules allow. On Linux Mint, a preference file named nosnap.pref deliberately blocks snapd, so move it away, run apt update and install again. On a plain Ubuntu system the package lists are usually stale or empty, so run apt update first.
Fix it fast
1Find out which cause you have
Look for the Mint block file and note which distribution you are on. If the file exists, the first cause applies; if not, go to the second.
lsb_release -a ls -l /etc/apt/preferences.d/2Match what you see, then jump to its fix
What does the error look like?
E: Package 'snapd' has no installation candidatePackage snapd is not available, but is referred to by another package.
Cause 1 of 2
Linux Mint blocks snapd with nosnap.pref
1Check
List the preferences folder. Mint ships a file called nosnap.pref there, and while it is in place apt will not install snapd.
ls -l /etc/apt/preferences.d/nosnap.pref2Fix
Rename the file so it no longer ends in .pref, refresh the package lists and install snapd. Log out and back in (or reboot) afterwards.
sudo mv /etc/apt/preferences.d/nosnap.pref /etc/apt/preferences.d/nosnap.bak
sudo apt update
sudo apt install snapd3Verify
Install the hello-world snap and run it. It prints Hello World!
snap install hello-world
hello-worldConfirmed by snapcraft.io
Cause 2 of 2
The package lists are stale or empty
1Check
apt works from index files that apt update downloads from the sources in /etc/apt/sources.list and /etc/apt/sources.list.d/. If that download never succeeded, the index has no entry for snapd.
sudo apt update2Fix
Run apt update until it finishes without errors, then install snapd. Fix any error it prints for a repository first, because a failed repository leaves its packages out of the index.
sudo apt update
sudo apt install snapd3Verify
Install and run the hello-world snap after logging out and in again.
sudo snap install hello-world
hello-worldConfirmed by snapcraft.io
How do I stop it coming back?
- Run sudo apt update before installing anything on a new or restored machine.
- Rename rather than delete nosnap.pref, so you can put Mint's default back later.
- Read the full apt update output once; an error on one repository line explains many 'no installation candidate' messages.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Related fixes
Servers
dnf cannot install MySQL on Amazon Linux 2023
dnf cannot find a mysql-server package on Amazon Linux 2023
Amazon Linux 2023 documents MariaDB, not MySQL, as its database server, with packages named mariadb105 and mariadb105-server.
3 causes, each with a fixServers
Ansible hangs, then times out waiting for the sudo prompt
a playbook using become seems to hang
Ansible ran sudo on the target and never saw the answer it expected.
3 causes, each with a fixServers
Apache on Ubuntu returns 404 Not Found for my site
The requested URL was not found on this server.
On Ubuntu a 404 from Apache usually means the request maps to a path that has no file.
3 causes, each with a fixServers
Apache returns 504 Gateway Timeout when PHP takes too long
Quick requests work, slow ones end in a 504 after a fixed wait
A 504 from Apache means the backend did not answer within the proxy timeout.
2 causes, each with a fixServers
Apache logs SIGWINCH and exits on its own
the httpd container stops although nothing crashed
SIGWINCH is Apache's graceful-stop signal.
2 causes, each with a fixServers
Apache warns that a ${VAR} config variable is not defined
${VAR} left unchanged in the configuration, with a warning in the error log
Apache expands ${VAR} from Define or from the shell environment that exists when the server starts.
3 causes, each with a fix