#! /bin/bash
# First check your kernel version, so you won't delete the in-use kernel image, running:
uname -r
# Now run this command for a list of installed kernels:
sudo dpkg --list 'linux-image*'
# and delete the kernels you don't want/need anymore by running this:
sudo apt-get remove --purge linux-image-${VERSION}
# When you're done removing the older kernels, you can run this to remove ever packages you won't need anymore:
sudo apt-get autoremove
# -or-
# simply enter the following into console and use auto-complete (TAB)
sudo apt-get purge linux-image-