查看当前系统内核
$ uname -a Linux linuxidc 4.13.0-32-generic #24-Ubuntu SMP Mon Feb 21 17:29:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
查看已安装的内核
$ dpkg --get-selections |grep linux-
删除所有 deinstall 结尾的, 以及未使用的generic结尾的
# deinstall sudo apt-get purge linux-image-4.10.0-38-generic sudo apt-get purge linux-image-4.10.0-40-generic sudo apt-get purge linux-image-4.10.0-42-generic sudo apt-get purge linux-image-4.13.0-26-generic sudo apt-get purge linux-image-4.8.0-36-generic sudo apt-get purge linux-image-extra-4.8.0-36-generic sudo apt-get purge linux-image-extra-4.10.0-38-generic sudo apt-get purge linux-image-extra-4.10.0-40-generic sudo apt-get purge linux-image-extra-4.10.0-42-generic sudo apt-get purge linux-image-extra-4.13.0-26-generic # 未使用的 generic sudo apt-get purge linux-image-extra-4.13.0-31-generic sudo apt-get purge linux-image-4.13.0-31-generic sudo apt-get purge linux-headers-4.13.0-31-generic