Each version of the kernel can occupy up to 150 MB. If you have downloaded the headers you get 250 MB of space.

To view the installed kernels

dpkg --list | grep linux-image

Lists the headers installed

ls /usr/src | grep 'linux-headers'

First remove the headers using somethings like this

sudo apt-get purge linux-headers-3.8.0-19

then remove any specific kernel that is no longer needed

sudo apt-get purge linux-image-3.8.0-19-generic


Command list for cleaning and repairing


sudo apt-get autoclean # only removes files that cannot be downloaded anymore (obsolete)
sudo apt-get clean



sudo apt-get update #resync package index
sudo apt-get upgrade #newest versions of all packages, update must be run first

#would upgrade you to the latest kernel in the repositories
#dist-upgrade is also able to remove existing packages if required

sudo apt-get dist-upgrade

# fix Broken packages -f

sudo apt-get -f install
sudo dpkg --configure -a

# Remove lock
# If you are absolutely sure you do not have another upgrade process running.
# Locked dpkg - only if sure you are not running another update.

sudo rm /var/lib/dpkg/lock
sudo dpkg --configure -a

# added zika's tip for problems with hash sum mismatch

sudo rm /var/lib/apt/lists/*
sudo apt-get update