I can't install a new kernel because by boot partition is full. However I also can't remove an old kernel:

sudo apt-get purge -f  linux-image-3.2.0-29-generic-pae
[.. reading package lists etc, standard stuff, not relevant & was too lazy to translate it]
The following packages have unmet dependencies:
 linux-image-generic-pae : depends on: linux-image-3.2.0-41-generic-pae but shall not be installed
E: unmet dependencies. try »apt-get -f install« without giving a package name (or give a solution).

Any idea how I can fix this? Thanks :-)

(Note: apt-get -f install also fails: not enough free space!)

  • I never tried that, but the man page mentions a parameter named -m aka --ignore-missing. So you could try sudo apt-get purge -m linux-image-3.2.0-29-generic-pae. The error message looks like you already tried to update, and that partly started but then broke due to lack of free space, so apt now sees some "inconsistent state". Having it ignore that might enable you to remove that package. However, make sure you have at least one working linux-image left, or your system might break completely (3.2.0-32 could still be there I guess). – Izzy Aug 28 '13 at 23:01
  • Thank you guys. purge -m didn't help, same problem. But the linked solution (manually removing one of the kernels and then removig it with apt-get too) helped. I could then install linux-image-3.2.0-41-generic-pae, after (!) that a normal apt-get upgrade was possible and removing older kernels too. – stefan.at.wpf Aug 29 '13 at 11:21

Are you running Linux 3.2.0-29-generic-pae? Try uname -r. To clean out OLD kernels, try:

Kver=$( uname -r)  
( dpkg -l linux-image\*; dpkg -l linux-doc\*;dpkg -l linux-headers\*) | egrep -v "$Kver"  

to get a list of obsolete packages you can apt-get purge.

You will be a sad bunny if you manage to delete your current kernel. Do you have a Live CD or install disk handy?

  • No, I wouldn't have deleted the current kernel ;-) I fixed it manually like mentioned in the linked duplicate. Your 2 lines, will they only list old kernels or also remove them? – stefan.at.wpf Aug 29 '13 at 11:22

Not the answer you're looking for? Browse other questions tagged or ask your own question.