due to this.My following upgrade commands end up with failure messages.
sudo apt-get upgrade | sudo apt-get dist-upgradeAfter reading some articles on http://askubuntu.com, I found this command to remove all kernels and headers, excluding current running kernel.
sudo apt-get purge $(dpkg -l linux-{image,headers}-"[0-9]*" | awk '/ii/{print $2}' | grep -ve "$(uname -r | sed -r 's/-[a-z]+//')")