Tag Archives: linux-server

How to Solve the “linux-server : Depends: linux-image-server” apt-get upgrade Error Tips, Tricks and Tutorials 19 FEB 2016

After cleaning out an unexpected /boot full fault on one of the Ubuntu servers that I maintain, I next encountered an equally frustrating problem whereby apt-get stopped working thanks to a mismatched kernel version issue (introduced because of the upgrade that had failed halfway thanks to the earlier running out of disk space in /boot!).

Essentially, any apt-get operation like say “apt-get upgrade” or “apt-get install -f” would result in the operation breaking with the following string appearing in the error message:

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

I spent a lot of time bashing away at this, trying to remove and install specific kernel versions, etc. (a lot of information on the issue can be found here), but in the end stumbled across this silly little fix that worked brilliantly efficiently:

sudo apt-get remove linux-server && sudo apt-get install linux-server

Yeah. Classics still work. When in doubt, uninstall and then reinstall!

dog fixing computer issues

How to Solve Ubuntu Server /boot full Issue Tips, Tricks and Tutorials 19 FEB 2016

If you manage an older Ubuntu server and do a lot of updates/upgrades, inevitably you’ll hit the annoying /boot full issue, which is essentially what happens when the ridiculously tiny /boot folder gets filled up with older kernel version as a result of all your upgrading.

To spot if this is in fact what currently plagues you, simply run the following command to get a quick snapshot of disk space usage:

sudo df -h

If your /boot directory is indeed full or close to 100%, you can run the following command that automatically locates and removes older kernels and headers from the system:

sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")

With those gone, you can now clean up a bit further by removing packages that aren’t necessarily needed any more (because they were automatically installed to satisfy dependencies for the newly removed packages):

sudo apt-get autoremove
sudo apt-get --purge remove && sudo apt-get autoclean

This should solve your issue.

cat using laptop

Note: If you can’t use apt-get at all because of this problem, you can try to manually delete the kernels yourself. Run the following to get an idea of what can be removed:

dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')"

With that list now in your possession, craft a remove operation using those version numbers listed above, followed by an attempt to solve the new dependency issue with apt-get e.g.

sudo rm -rf /boot/*-3.2.0-{101,102,103}-*
sudo apt-get -f install

(As always though, tread with care though when it comes to messing with this part of your server install…)