Ubuntu – apt-get package is not available but is referred to by another package – but cannot find that package

aptpackage-management

When I try to install a package with apt-get install, I'll occasionally see a message of the form

Package somePackage 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 somePackage has no installation candidate

Does anyone know how to find out what package(s) it is actually referring to?

Note:

I looked at "But is referred to by another package." – Finding that package and it suggested using apt-cache search to find the package that refers to it. Yet if I do this for somePackage, I won't get any output.

For example, apt-cache search openoffice.org-hunspell returns no output, but apt-cache search gcc returns several packages.

Edit:

There are several different packages that have caused the first part of the problem for me in the past, but the apt-cache search not turning anything up has (so far) only happened for the openoffice.org-hunspell package.

I guess that what I want to know the most is this: when I see the error message "Package somePackage has no installation candidate," I'd like to have a sure-fire way to know

  1. Was it replaced with another package (in which case knowing what the new package name is would be helpful); or
  2. Was it just removed altogether; or
  3. Is there some problem with /etc/apt/sources.list that means I can't get it.

Best Answer

I had this kind of errors when the universe repos were not enabled (it was a minimal server install). Enabling them solved the issue (the package were provided by such repos). HTH.