It is not unusual for a user of Ubuntu (or other distro using the apt package management tool to encounter the error:
user@box ~ $ sudo apt install x
[sudo] password for user:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package x 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 'x' has no installation candidate
There have been several questions asked concerning this on various Stack Exchange sites, for example Package network-manager-openvpn is not available on Ask Ubuntu, but these are generally about how to obtain the specific package despite the error.
I have found no package that is not found simply (though not always easily) by determining if it is still distributed, and under which repository, and ensuring the repository is in sources.list, or if the worst comes to worst, downloading a .deb file or a source file to compile.
So my question is more general, and although I am guessing it has a rather simple and therefore non-exciting answer I cannot think how to find it by conventional search engine methods, so I turn to Ask Ubuntu.
Is there a command or option I can use to determine what package(s) reference the missing package?
apt-get update
followed byapt-get upgrade -y
because-y
bypasses user confirmation. It makes no sense using it withapt-get update
. Even so, this doesn't answer the question, at all. – Feb 01 '17 at 02:46apt-get update
. – David Foerster Feb 01 '17 at 11:59apt-get update
answers the A-B question (the package exists in the repo butapt-get install
andapt-cache
don't know about it.) – dcorking May 03 '18 at 09:45sudo apt-get update
is free of controversy and was the correct solution for me. – Daryn Oct 31 '19 at 10:14Package php-pear is not available, but is referred to by another package
. It's a docker installation on wsl2 environment. – mirapole Aug 04 '20 at 05:52rm -rf /var/lib/apt/lists/*
after installing packages. The above solution worked for me. – Stefan Rickli Mar 12 '21 at 20:06lsb-core
package on Ubuntu, but not on Debian. But then I found out that apparently Debian discontinued LSB support in 2015 (LSB = Linux Standard Base). By runningapt list lsb*
, I found out thatlsb-base
andlsb-release
are the only two supported LSB packages. So all I needed to do to install thelsb_release
command was to run:sudo apt install -y lsb-release
. – Henke - Нава́льный П с м Nov 21 '22 at 17:11