如何防止在删除内核时安装更新的内核?

如何防止在删除内核时安装更新的内核?

在 Ubuntu 上,我在使用一个新内核 ( ) 时遇到了一些问题,4.18.0-20因此我在一个旧内核 ( 4.18.0-15) 上重新启动。

现在我想卸载新内核以防止任何混淆,但这样做是apt为了安装更新的内核:

apt -s remove linux-image-4.18.0-20-generic    
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  linux-generic-hwe-18.04 linux-headers-4.18.0-21 
  linux-headers-4.18.0-21-generic linux-headers-generic-hwe-18.04 
  linux-image-4.18.0-21-generic linux-image-generic-hwe-18.04
  linux-modules-4.18.0-21-generic linux-modules-extra-4.18.0-21-generic
The following packages will be REMOVED:
  linux-image-4.18.0-20-generic linux-modules-extra-4.18.0-20-generic
The following NEW packages will be installed:
  linux-headers-4.18.0-21 linux-headers-4.18.0-21-generic linux-image-4.18.0-21-generic
  linux-modules-4.18.0-21-generic linux-modules-extra-4.18.0-21-generic
The following packages will be upgraded:
  linux-generic-hwe-18.04 linux-headers-generic-hwe-18.04 linux-image-generic-hwe-18.04

因此apt想要安装内核,4.18.0-21因为它删除了4.18.0-20.

我该如何解释这不是我想要的?

答案1

问题来自于linux-image-generic-hwe-18.04 包裹

正是这个带来了混乱。

解决方案:删除它并安装linux-image-generic

sudo apt install linux-image-4.18.0-20-generic  
sudo apt remove linux-image-generic-hwe-18.04

如果需要的话,对包也可以做同样的事情linux-headers*

如果您想将内核设置为特定内核,您可以手动安装它,例如

sudo apt install linux-image-generic
sudo apt remove linux-image-generic-hwe-18.04

相关内容