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 (=; however:
Version of linux-image-server on system is
linux-server depends on linux-headers-server (=; however:
Version of linux-headers-server on system is
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:
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.
$ sudo dpkg -i linux-server_3.