/Boot out of space

Poolbeg Control Room Panoramic - AKA - Homers Desk...

There comes a time after a linux box has been running a while and it has acquired many updated versions of kernels installed on it the Boot drive will eventually run out of space. At that point the only thing that is left to do is remove some of the old kernels and clean up the drive. This can easily be done with the command
sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")

to remove all but the current kernel. This worked wonders for my NAS that is currently running Ubuntu 13.04 raring.
Linux Notatoy

Leave a Reply

Your email address will not be published. Required fields are marked *