5th October 2016

1st November 2016 at 1:01pm
Journal

Removing old Ubuntu kernel images:

for kernel in $(ls -1 /boot/vmlinuz-* | egrep -o '[0-9\.-]+' | sed -r 's/^-//;s/-$//' | sort -r | tail -n +3) ; do sudo apt-get purge "linux-image-${kernel}" ; done

... or just sudo apt-get autoremove-kernels