懒人方法:
uname -a
列出目前使用的内核
dpkg -l | grep linux-image
列出存在的linux内核
sudo apt-get purge linux-image-3.16.0-23-generic
purge 老的内核
如果想升级:
sudo apt-get dist-upgrade
以下是详细的方法:
To list all kernel:dpkg --get-selections | grep "linux-image-[[:digit:]].*" | tr " " ";" | cut -d ";" -f1
简单的命令 dpkg -l |grep "linux-image"
The results looks somewhat like this:
linux-image-3.19.0-7-generic
linux-image-3.18.0-13-generic
linux-image-3.16.0-23-generic
Don't delete all kernels, only old ones!
Next let's remove the 3.16 kernel,sudo apt-get purge linux-image-3.16.0-23-generic
------------------------------------------------------------------------------------------------------------
from: https://askubuntu.com/questions/746903/trouble-with-apt-get-install-due-to-multiple-linux-images
Alternative way:
An alternative is Synaptic
sudo apt-get install synaptic
After installing and running the program- search:
linux-image
Right-click a kernel and choose complete removal and finally click the Apply button to delete the kernel.
Repeat the search but this time for linux-header - you can delete the associated headers for the kernel image chosen previously.
Synaptic though will not attempt to verify what you are trying to remove... you could inadvertently delete your newest kernel - or even delete all of your kernels via this tool leaving you with an unbootable Ubuntu!.