What does "Package <package> has no installation candidate" mean?

What does the above Error mean? What is an installation candidate?

I was trying to do

sudo apt-get install munin-memcached  

and I get this message:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package munin-memcached is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package munin-memcached has no installation candidate

I googled for the problem and someone said to do a apt-get upgrade but it still did not solve my problem.


Solution 1:

This happens when you try to install a package about which APT does not have any idea. When you add software sources, you need to do an apt-get update so that your system APT's database is updated with all the packages on the repositories listed in the software sources lists.

Then when you try to install any package, APT checks the package name in it's database, finds it and checks the name of the repo from where it got it. It then downloads the package from that repo.

This means of all the repositories listed in your software sources, none of them have the package named munin-memcached. I checked again and it is not available in official Ubuntu repos.

After a bit of googling I found that it is available in this PPA: chris-lea/munin-plugins

Add this PPA and install the packages at your own risk. I do not know this person.

To add the PPA, issue the below command:

sudo add-apt-repository ppa:chris-lea/munin-plugins

To install package munin-memcached, issue the below command:

sudo apt-get update && sudo apt-get install munin-memcached

Solution 2:

That means that some installed package is saying that it needs a package called munin-memcached to work. But the package manager doesn't find it in the repositories. It is usually followed by some info about what packages are missing it, but it didn't here.

There is no package name munin-memcached in the standard Ubuntu repos, so you are likely using some extra repository. If you post it here we can try to found the cause.

Solution 3:

What does Package <package> has no installation candidate means that the package is not found in your Ubuntu releases software sources.

One possible reason for this message is that this package is an old package that has been discontinued from your release's default repositories. For example, qt4-default has been discontinued from the default repositories in Ubuntu 20.04 and later. To check for this possibility run the following command:

rmadison <package>

This command will show which Ubuntu releases provide this package and also will show which repository provides this package.

Another possible reason for this message is that this package is not available for your computer's CPU architecture. This is worth checking if your computer has an ARM processor. Once again run rmadison <package> to show this information. rmadison <package> will also show if the package you are looking for is only available as source code in which case you must download the package's source code with apt-get source <package>, build a .deb file from the source you downloaded with a program such as checkinstall, and install the .deb file with sudo apt install ./package.deb

Another possible reason for this message is that this package is not found in the list of available software because the list of available software software in the software sources has not been updated. To update the list of available software run the following command:

sudo apt update

aptitude is a terminal-based package manager with a command-line mode similar to that of apt-get only it is smarter. aptitude can help to resolve package conflicts that generate a E: Package 'package-name' has no installation candidate error message.

sudo apt install aptitude
sudo aptitude install package-name # replace package-name with the name of a package

Let's say you get the following error message in Ubuntu 20.04.

E: Package 'libssl0.9.8' has no installation candidate

It seems that libssl is probably available in the Ubuntu 20.04 default repositories, but it has been renamed because libssl has been upgraded to a newer version. To check if libssl0.9.8 has been renamed in Ubuntu 20.04 run the following command:

apt-cache search "^libssl.*"

The results of apt-cache search "^libssl.*" in 18.04-22.04 show that libssl0.9.8 has been upgraded to libssl1.1.