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 (= 22.214.171.124.82) but 126.96.36.199.90 is installed
Depends: linux-headers-server (= 188.8.131.52.82) but 184.108.40.206.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.