Upgrade Ubuntu server with boot partition full

At certain point my small silent server needed an extra package, but running apt-get only gave me errors. Digging further I found that my /boot partition (default Ubuntu server setup) was running out of disk space. After manually deleting old versions of images I finally got space, but that didn’t fix broken packages, e.g.:

$ sudo apt-get -f install
dpkg: dependency problems prevent configuration of linux-server:
linux-server depends on linux-image-server (= 3.2.0.53.63); however:
Version of linux-image-server on system is 3.2.0.58.69.
linux-server depends on linux-headers-server (= 3.2.0.53.63); however:
Version of linux-headers-server on system is 3.2.0.58.69.
dpkg: error processing linux-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
linux-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

The only fix I have found was downloading and installing the missing package manually:

$ wget https://launchpad.net/ubuntu/+archive/primary/+files/linux-server_3.2.0.58.69_amd64.deb
$ sudo dpkg -i linux-server_3.2.0.58.69_amd64.deb

Enjoy!