I was trying to upgrade my Ubuntu server and got this error this morning:
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
linux-server : Depends: linux-image-server (= 184.108.40.206.82) but 220.127.116.11.90 is installed
Depends: linux-headers-server (= 18.104.22.168.82) but 22.214.171.124.90 is installed
E: Unmet dependencies. Try using -f.
I ran the apt-get -f install command over and over but It kept failing. Then I found the solution:
$ sudo aptitude install linux-headers-server
aptitude is smarter at dependency solutions than apt-get. It fixed the issue and the server is fine now.