先查看系統內核版本
uname -a
查看所有內核版本
dpkg --get-selections|grep linux
刪除舊內核版本
apt autoremove --purge
或
apt-get remove linux-image-*
apt-get remove linux-headers-*
列出已經刪除但是狀態爲deinstall的內核
dpkg --get-selections | grep deinstall | cut -f1
刪除狀態爲deinstall的內核
dpkg --purge `sudo dpkg --get-selections | grep deinstall | cut -f1`