Ubuntu /boot is full one-line fix

After running my Ubuntu systems on nagios, I noticed that fresh installs of 12.04 have /boot volumes that get prematurely full. This is a common problem because old out-dated kernels do not get deleted. I have found this one-liner all over the internet but I put it here so I can reference it.

dpkg --get-selections|grep 'linux-image*'|awk '{print $1}'|egrep -v "linux-image-$(uname -r)|linux-image-generic" |while read n;do apt-get -y remove $n;done

Leave a Reply

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