Skip to content

Instantly share code, notes, and snippets.

@simonid
Last active December 3, 2017 08:34
Show Gist options
  • Save simonid/d9fc35d9ee5d445762f5804997b60bec to your computer and use it in GitHub Desktop.
Save simonid/d9fc35d9ee5d445762f5804997b60bec to your computer and use it in GitHub Desktop.
Ubuntu卸载内核

Ubuntu卸载内核

查看内核

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment