Problem with package installation - linux-image-server

Solution 1:

So, I force removed all of the related packages, rebooted and then apt-get -f install was happy. What I did was:

dpkg --remove --force-remove-reinstreq linux-headers-server
dpkg --remove --force-remove-reinstreq linux-image-server
dpkg --remove --force-remove-reinstreq linux-headers-3.2.0-56-generic
dpkg --remove --force-remove-reinstreq linux-headers-3.2.0-56
dpkg --remove --force-remove-reinstreq linux-server

and then

apt-get -f install

And that fixed it. To get a list of all packages I used dpkg --get-selections. There is a very useful post for cleaning previous versions here.

Solution 2:

This post was such a blessing for me thanks. Can't tell you how many hours were wasted but this was the best post to deal with my issue. Likewise my boot drive was at 100% capacity and there was a similar dependency issue that had to be resolved otherwise apt-get upgrade would fail. In short below are the commands that I did replacing the headers version number with xx as mine were slightly different. Anyone else getting a similar error will need to read it clearly to find out what version number they need to add.

dpkg --remove --force-remove-reinstreq linux-headers-server
dpkg --remove --force-remove-reinstreq linux-image-server
dpkg --remove --force-remove-reinstreq linux-headers-3.2.0-xx-generic
dpkg --remove --force-remove-reinstreq linux-headers-3.2.0-xx
dpkg --remove --force-remove-reinstreq linux-server

Now Reboot server

shutdown -r now

apt-get autoremove
apt-get -f install
apt-get remove --purge $(dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d')

The final command reduced the usage of my boot drive down to 16% See following URL for more info on command How do I remove old kernel versions to clean up the boot menu?.

Thank you so much miha for posting your solution.