How-To: Purge old Ubuntu kernels

Long ago, far away, and right next door, Nick and I discussed Ubuntu and its kernel management.

It all started with my comment that it is wasteful to have all these kernels lying around and never booted into again.

I went searching and did not find much on how to remove those old kernels in an efficient way but eventually I figured it out.

Then Nick wrote it into a script to automate this functionality so I decided to share it with the world. We use this in our vmForge auto-install ISO images after the install has finished and the system updated.

Disclaimer: no warranties, blah blah, you’re on  your own, don’t blame the messenger, always eat your vegetables.

And there ya have it.