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
sudo apt-get autoremove-kernels