Thursday, September 10, 2015

Purging old kernels to make room on /boot

I've installed Linux on lots of laptops and desktops by now, and like most people I succumbed to the desire to make some custom decisions on how the system should be configured. One of the most basic decisions is the layout of the system across multiple partitions. There are some technical advantages to having a separate /boot partition, but (especially with Ubuntu, which is what I use) the /boot partition eventually fills up with old kernels and you are unable to perform the standard software updates because the drive doesn't have enough free space. There are a number of recommended ways to clear out these old kernels, but most involve lots of scripting or command line magic. Oddly, there is not a one-button solution within the software updater, where it would be incredibly convenient. But there is a simple command from the bikeshed package to handle this problem.

Bikeshed is a catchall package for various tools or scripts that don't really belong anywhere else and which make some system tasks easier. (Bikeshedding is an older term for dwelling on trivialities instead of the important stuff that was absorbed into computer science from Parkinson's Law of Trivialities, if you are curious about the etymology.) In any case, after installing the bikeshed package in Ubuntu, the old kernels can be cleared out with the command sudo purge-old-kernels. The old kernels are cleared out (the most recent two are kept, though this is configurable), GRUB is updated with the remaining kernels, and your /boot partition is cleaned out enough to continue your upgrade. Almost as easy as one button.

No comments:

Post a Comment