PDA

View Full Version : 12.04 linux-generic dependency issues



delsdog
December 21st, 2015, 10:42 AM
Hi all,
I've got an old webserver running sites that can't really be taken down for any length of time on a 12.04 box that I have been quite happy with, updates have been running fine until this weekend and now I am getting errors when I try to update.


Do you want to continue [Y/n]?
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-image-generic (= 3.2.0.96.112); however:
Version of linux-image-generic on system is 3.2.0.97.113.
linux-generic depends on linux-headers-generic (= 3.2.0.96.112); however:
Version of linux-headers-generic on system is 3.2.0.97.113.
dpkg: error processing linux-generic (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates it's a follow-up error from a previous failure.
Errors were encountered while processing:
linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)

I've tried freeing up space by getting rid of old kernels as suggested in many places http://ubuntuforums.org/showthread.php?t=2240240 for example, the partition was indeed full but I still end up with the same error.

Also tried cleaning (apt-get clean), but I don't think that's the issue either i.e. it has no effect.

Any suggestions would be much appreciated, the webserver continues to run ok, but it does now have a lack of updates.

Derek

ian-weisser
December 21st, 2015, 04:36 PM
Look carefully at the error message. You have a version mismatch.



linux-generic depends on linux-image-generic (= 3.2.0.96.112); however:
Version of linux-image-generic on system is 3.2.0.97.113.
linux-generic depends on linux-headers-generic (= 3.2.0.96.112); however:
Version of linux-headers-generic on system is 3.2.0.97.113.


This kind of error often happens when you ran out of space in the past: A updated, B didn't.
Apt is stuck because it has an A-or-B situation, and it can't tell which choice you want.

The simple way to fix a version mismatch is to make apt to download and install the correct version of the correct package.
Here's how to do that:

sudo apt-get update # Update your package database
sudo apt-get clean linux-generic # Delete your cached version of linux-generic (3.2.0.96.112) so it doesn't get reinstalled
sudo apt-get install --reinstall linux-generic # Download and install a new version of linux-generic, which happens to be the new version (3.2.0.97.113)

After apt is functioning again:
Use autoremove and autoclean to free space. Yes, both - they do different things.
Schedule them. Run them daily or weekly if storage space is tight.