0

My update manager stalls because it says I do not have enough space. So I need to delete old kernels.

The usual routine is to search Synaptic Package Manager for 'linux' or somesuch and try and discern from the fog of versions and variations of kernel which can be deleted - the aim being to leave the two most recent installations intact: the one currently in use and one other as a fallback. It's usual to see kernels and kernal images. I usually just leave the two most recent of each.

I find today, however, my sub-intelligent guesswork is inadequate.

Synaptic seems to show I have five kernals installed, or consuming disk space at least, of varying naming conventions. Aside from wondering how demented the rituals must have been that summoned such a demonic system as this, I find it less obvious than ever which can be deleted.

Synaptic says the following kernels and modules are installed:

linux-image-4.4.0-38-lowlatency 4.4.0-38.57 linux kernal image for version 4.4.0
linux-image-4.4.0-42-lowlatency 4.4.0-42.62 linux kernal image for version 4.4.0
linux-image-4.4.0-45-lowlatency 4.4.0-42.66 linux kernal image for version 4.4.0
linux-image-lowlatency 4.4.0.45.48 4.4.0.47.50 lowlatency linux kernal image
linux lowlatency 4.4.0.45.48 4.4.0.47.50 complete lowlatency linux kernel

I would normally just blindly delete anything with a number less than the two highest numbers there. But here there are two sorts of kernal image, with the one that looks most important having the oldest number. And the only one that looks like an actual installed kernel also has the old, old number that would normally indicate it should be deleted.

So if I delete the ones here that have the oldest numbers I would be deleting the two that look like they most need to be kept. If they do need to be kept that would suggest the more recent 'images' are all superfluous. Yet if I delete all the superfluous-looking images I would be left with what I would assume is just one kernel.

Which ones can be deleted and which ones should be kept, and why?

  • Which is the output of uname -r ?. Depending on this, you will know which Kernel image you should not remove. That's a start point. – GTRONICK Nov 11 '16 at 12:22
  • Homkay, cool. I'll be back... – markling Nov 14 '16 at 15:55
  • Oh i was sch a numpty i couldn't even see which was highest of five, seven-digit, five-part numbers with slightly varying file associations! I see now it was 4.4.0.45.48! What a dolt! Don't tell Mensa or they might black-list me! – markling Nov 14 '16 at 22:29
  • Lol. Don't worry. The important thing is that, you learned something and you are in the correct way. Best regards! – GTRONICK Nov 15 '16 at 12:49
  • Alas, I learned nothing, but was reminded, as periodically, about the inherent unsuitability of linux to people who don't speak robot and have neither the time, inclination or training to learn it. – markling Nov 19 '16 at 12:58
0

To free up space on the root file system you can try to execute

apt-get clean
apt-get autoclean

If that doesn't work you can go to /var/cache/apt/archives and manually remove a few files from the cache to get some space back, e.g.:

sudo rm linux-headers-*

t won't hurt to remove all of the .deb files here if you need to--that is what apt-get clean does. They will be automatically be re-downloaded by apt if they are again needed.

| improve this answer | |
  • Thank you for the suggestion. But the question was which can be deleted and why. Not sure about this rm linux... business. – markling Nov 14 '16 at 15:57
  • The last command, will delete all the packages containing the string "linux-headers-" in their names, so, don't do that unless you are sure what you want to remove. – GTRONICK Nov 15 '16 at 12:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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