Ubuntu – Unmet dependencies: linux-generic


Today I went over to my grandma because she had some problems with her computer, running Xubuntu 12.04LTS. After fixing 'the problem' (Firefox was set fullscreen..) I ran the usual apt-get update && apt-get dist-upgrade to immediately update everything. Instead I was greeted by an error that some packages where not correctly installed. So I ran dpkg --configure -a. My guess is that, because Firefox was fullscreen, she couldn't figure out how to turn of her computer and had simply turned it of, probably at the exact moment when it was installing automatic security updates.
Running dpkg --configure -a however only left me with an error message about unmet dependencies for linux-generic. When running apt-get dist-upgrade again, it told me the same and I should try the -f option. However, even while trying to force the upgrade it still wont install them.

This is the output from the commands (added LANG=C because default language is Dutch).

jeroen@Bomma:/home/bomma$ LANG=C sudo apt-get dist-upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 linux-generic : Depends: linux-image-generic (= but is installed
                 Depends: linux-headers-generic (= but is installed
E: Unmet dependencies. Try using -f.

Running it with -f:

jeroen@Bomma:/home/bomma$ LANG=C sudo apt-get -f dist-upgrade 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
Calculating upgrade... Done
The following packages will be upgraded:
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/1.722 B of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]?  
dpkg: dependency problems prevent configuration of linux-generic:
 linux-generic depends on linux-image-generic (=; however:
  Version of linux-image-generic on system is
 linux-generic depends on linux-headers-generic (=; however:
  Version of linux-headers-generic on system is
dpkg: error processing linux-generic (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
    Errors were encountered while processing:
E: Sub-process /usr/bin/dpkg returned an error code (1)

I'm out of ideas on how to solve this (other than quickly reinstalling her pretty default xubuntu)? Trying to remove and reinstall the linux-generic package seems rather risky, but maybe that would solve it?

Best Answer

Removing linux-generic will do no harm at all. It is only a "meta-package" depending on linux-image-generic and linux-headers-generic. Those two are themselves meta-packages depending on the respective latest image/headers packages.

You can see this for yourself by issuing apt-cache show linux-generic, apt-cache show linux-image-generic and apt-cache show linux-headers-generic.

The purpose of meta-packages is to pull-in the packages on which they depend, they have no functionality at all. On the other hand removing one will not remove it's dependencies - so no danger to the system.

After having fixed the original issue you can of course install linux-generic again.