如何回滚到 16.04 上的旧内核/清除内核并自动安装新内核?

如何回滚到 16.04 上的旧内核/清除内核并自动安装新内核?

unattended-upgrade最近自动将我的内核升级到 4.4.0-143,但它不适用于 Nvidia 显卡,所以我决定回滚到以前的版本。

我能够启动到较旧的内核(4.4.0-141),并确认我正在使用该内核启动我的计算机:

4.4.0-141-generic

但是当我尝试时apt purge linux-image-4.4.0-143-generic,apt 提示我确认:

The following NEW packages will be installed:
  linux-image-unsigned-4.4.0-143-generic

那么,为什么卸载已签名的内核需要安装未签名的版本?我如何才能安全地删除较新的(143)内核?提前致谢!

apt purge 的完整输出:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  amd64-microcode intel-microcode iucode-tool linux-headers-4.4.0-137 linux-headers-4.4.0-137-generic linux-headers-4.4.0-138 linux-headers-4.4.0-138-generic linux-headers-4.4.0-139 linux-headers-4.4.0-139-generic linux-headers-4.4.0-141 linux-headers-4.4.0-141-generic
  linux-image-4.4.0-137-generic linux-image-4.4.0-138-generic linux-image-4.4.0-139-generic linux-image-4.4.0-141-generic linux-image-extra-4.4.0-137-generic linux-image-extra-4.4.0-138-generic linux-image-extra-4.4.0-139-generic linux-image-extra-4.4.0-141-generic
  linux-signed-image-4.4.0-137-generic linux-signed-image-4.4.0-138-generic linux-signed-image-4.4.0-139-generic linux-signed-image-4.4.0-141-generic thermald
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  linux-image-unsigned-4.4.0-143-generic
Suggested packages:
  fdutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools
The following packages will be REMOVED:
  linux-generic* linux-image-4.4.0-143-generic* linux-image-generic* linux-signed-generic*
The following NEW packages will be installed:
  linux-image-unsigned-4.4.0-143-generic
0 upgraded, 1 newly installed, 4 to remove and 140 not upgraded.
Need to get 7,049 kB of archives.
After this operation, 386 kB of additional disk space will be used.
Do you want to continue? [Y/n] n

答案1

我自己根据 @mikewhatever 已删除答案的提示找到了答案。(请参阅他的评论,https://askubuntu.com/users/20054/mikewhatever

原因是有些软件包依赖于 或linux-image-4.4.0-143-genericlinux-image-unsigned-4.4.0-143-generic因此,只需清除signed内核即可触发自动安装一个unsigned软件包以满足依赖关系。

所以我检查了linux-image-4.4.0-143-generic

# apt-cache rdepends linux-image-4.4.0-143-generic
linux-image-4.4.0-143-generic
Reverse Depends:
 |linux-image-generic
 |linux-modules-extra-4.4.0-143-generic
 |linux-image-virtual
  linux-image-unsigned-4.4.0-143-generic

并清除所有已报告的内容。然后我就可以linux-image-4.4.0-143-generic轻松清除了。

看:apt-get --remove 触发包安装?

相关内容