The following packages have unmet dependencies!
You can install the package using.
make sure the repo sources are up to date
sudo apt-get update
To Install the package.
sudo apt-get install packagename
Once the package determines that you have some missing dependencies, run the following command to fix broken or missing dependencies.
sudo apt-get install -f
Above command will only download the missing dependencies if you have already installed the package.
I know I'm a bit late, but none of the above solutions worked for me. What really solved my problem was to use aptitude
instead of apt-get. aptitude
will suggest resolutions to the problem.
Simply run these:
sudo apt-get install aptitude
sudo aptitude install <package-name>
aptitude
will suggest dependencies resolution for you e.g:
The following actions will resolve these dependencies:
Keep the following packages at their current version:
1) libyaml-dev [Not Installed]
Accept this solution? [Y/n/q/? (n)
The following actions will resolve these dependencies:
Downgrade the following packages:
1) libyaml-0-2 [0.1.4-3ubuntu3.1 (now) -> 0.1.4-3ubuntu3 (trusty)]
Accept this solution? [Y/n/q/?] (Y)
as discussed in this post.
Sometimes the dependencies that need fixing are unrelated to the program you are trying to install. In my case it was giving off this error:
The following have unmet dependecies
shashlik : Depends: libc6-i386 but it is not going to be installed
Depends: lib32gcc1 but it is not going to be installed
Depends: lib32z1 but it is not going to be installed
It turned out that I had tried to install a program called "Shashlik" and the installation had failed. So I ran the code:
sudo apt-get --purge remove shashlik
And then I ran:
sudo apt install autoconf
This seemed to fix the error as my program then installed. I am not sure how much the second command helped but I put it there in case it was necessary for the solution to work.