mtg

Remove old kernels and free up space in /boot partition

This is a great one-liner which removes old kernel images and frees up space in your boot partition:

$ sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")

This comes from the top answer to a question on ask ubuntu.