dpkg --list | grep linux-image
dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge
if you’ve upgraded your system, or had an update with a new kernel, please reboot your machine before running above the command
sudo update-grub2
All done.