dpkg --get-selections | grep linux
apt-get remove xxx
如果报错:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package linux-headers-4.10.15-041015 needs to be reinstalled, but I can't find an archive for it.
备份源dpkg信息:
cp /var/lib/dpkg/status /var/lib/dpkg/status.bkup
编辑dpkg:
vi /var/lib/dpkg/status
找到想要卸载的内核
更新:
apt-get update
If you get nowhere with any of the other offerings I've used this in the past
dpkg --remove --force-remove-reinstreq
From the dpkg manual remove-reinstreq: Remove a package, even if it's broken So run:
dpkg --remove --force-remove-reinstreq linux-headers-3.0.0-19
上述两个方法来自stackoverflow