How do I resolve unmet package dependencies?
The most common problem that Ubuntu users face is unmet dependencies.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
package1 : Depends: package2 (>= 1.8) but 1.7.5-1ubuntu1 is to be installed
E: Unable to correct problems, you have held broken packages.
What can we do to resolve this:
If the error shows something like this:
<some-package>: Depends: <other-package> (= version) but this-version is to be installed
Then make sure that the restricted and universe repositories are enabled. Press Alt+F2, type software-properties-gtk and hit Enter or search for software & updates in the dash.
Under Ubuntu Software tab, enable all the repositories.
One possible cause of unmet dependencies could be corrupted package database, and/or some packages weren’t installed properly. To fix the problem open a terminal type the following commands:
sudo apt-get clean
You can also run:
sudo apt-get autoclean
sudo apt-get -f install
The -f here stands for “fix broken”. Apt will attempt to correct broken dependencies. If you manually installed a package that had unmet dependencies, apt-get will install those dependencies, if possible, otherwise it may simply remove the package that you installed in order to resolve the problem.
sudo dpkg --configure -a
Then run this again:
sudo apt-get -f install
If the output is:
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
That means it failed.
Next solution is to run:
sudo apt-get -u dist-upgrade
If it shows any held packages, it is best to eliminate them. Packages are held because of dependency conflicts that apt cannot resolve. Try this command to find and repair the conflicts:
sudo apt-get -o Debug::pkgProblemResolver=yes dist-upgrade
If it cannot fix the conflicts, it will exit with:
0 upgraded, 0 newly installed, 0 to remove and 6 not upgraded.
Delete the held packages one by one, running dist-upgrade each time, until there are no more held packages. Then reinstall any needed packages. Be sure to use the --dry-run option, so that you are fully informed of consequences:
sudo apt-get remove --dry-run package-name
Since removing the package you are trying to install may not be ideal, you might also try finding a repository that has the packages you need to satisfy the dependencies.
Finally, if all else fails, you can attempt to satisfy the dependencies yourself, either by finding and installing the necessary packages, or by installing them from source and then creating “deb” packages for them.