I'm trying to install a package, but the package manager (
apt-get, software center, etc.) refuses to install it due unmet dependencies.
Are my attempts to install the package causing the dependencies issue? How can I tell what the issue is?
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
If you are installing an specific package/program and you hit a dependency issue there are two causes:
The first case is easy to figure out. Just execute
sudo apt-get check. This will report you any problem with the already installed packages and you will know how to solve them.
sudo apt-get check Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt-get -f install' to correct these. The following packages have unmet dependencies: libpurple-dev : Depends: libpurple0 (>= 2.10.9) but it is not installed Depends: libpurple0 (< 2.10.9+1~) but it is not installed pidgin : Depends: libpurple0 (>= 2.8.0) but it is not installed pidgin-whatsapp : Depends: libpurple0 (>= 2.8.0) but it is not installed E: Unmet dependencies. Try using -f.
Normally if you didn't install any packages manually with
dpkg, you have missing mirrors, broken PPA's or a mix of different version repositories (like Debian's and Ubuntu's or Precise and Saucy) this could be fixed with a simple
sudo apt-get -f install. If that doesn't fix it, you may need to ask for help adding all the results of the operations you attempted plus the output of
apt-cache policy for all relevant packages:
apt-cache policy pidgin-whatsapp pidgin libpurple-dev libpurple0
Now, if that results clean and the dependency issue only happens when you try to install a package, you may need to know why apt is refusing to install the package. This is tiring to do and would pose a hurdle if you want to solve your issue fast, and each problem has it's own solution. Is recommended in such cases using
aptitude. First we install it:
sudo apt-get install aptitude
Now you will ask aptitude why you can not install the package using:
aptitude why-not package
It will show you a nice list telling you why the package can't not be installed. It could be a missing package, that depends on a package that isn't available, or some other package that has conflicts/breaks it. Example:
aptitude why-not lsb-core:amd64 i lsb-security Recommends lsb-core (>= 4.1+Debian12) i A lsb-core Conflicts lsb-core:amd64
In this case, I have installed lsb-security package, which installed lsb-core 32-bits version, and doesn't allow me to install the 64-bit version.