为什么我的系统上有这么多内核?

为什么我的系统上有这么多内核?

以下是我的系统上安装的许多映像的列表。我不知道为什么会有这么多。为什么自动清除参数不能处理这个混乱的情况?请告诉我为什么会发生这种情况。我是否在不知情的情况下安装或启用了某些设置?谢谢。

ii  linux-image-5.11.0-25-generic                 5.11.0-25.27~20.04.1                        amd64        Signed kernel image generic
ii  linux-image-5.11.0-27-generic                 5.11.0-27.29~20.04.1                        amd64        Signed kernel image generic
ii  linux-image-5.11.0-34-generic                 5.11.0-34.36~20.04.1                        amd64        Signed kernel image generic
ii  linux-image-5.11.0-36-generic                 5.11.0-36.40~20.04.1                        amd64        Signed kernel image generic
ii  linux-image-5.11.0-37-generic                 5.11.0-37.41~20.04.2                        amd64        Signed kernel image generic
ii  linux-image-5.11.0-38-generic                 5.11.0-38.42~20.04.1                        amd64        Signed kernel image generic
ii  linux-image-5.11.0-40-generic                 5.11.0-40.44~20.04.2                        amd64        Signed kernel image generic
ii  linux-image-5.11.0-41-generic                 5.11.0-41.45~20.04.1                        amd64        Signed kernel image generic
ii  linux-image-5.11.0-43-generic                 5.11.0-43.47~20.04.2                        amd64        Signed kernel image generic
rc  linux-image-5.4.0-66-generic                  5.4.0-66.74                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-66-lowlatency               5.4.0-66.74                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-67-generic                  5.4.0-67.75                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-67-lowlatency               5.4.0-67.75                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-70-generic                  5.4.0-70.78                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-70-lowlatency               5.4.0-70.78                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-71-generic                  5.4.0-71.79                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-71-lowlatency               5.4.0-71.79                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-72-generic                  5.4.0-72.80                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-72-lowlatency               5.4.0-72.80                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-73-generic                  5.4.0-73.82                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-73-lowlatency               5.4.0-73.82                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-74-generic                  5.4.0-74.83                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-74-lowlatency               5.4.0-74.83                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-77-generic                  5.4.0-77.86                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-77-lowlatency               5.4.0-77.86                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-80-generic                  5.4.0-80.90                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-80-lowlatency               5.4.0-80.90                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.4.0-81-generic                  5.4.0-81.91                                 amd64        Signed kernel image generic
rc  linux-image-5.4.0-81-lowlatency               5.4.0-81.91                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.8.0-50-generic                  5.8.0-50.56~20.04.1                         amd64        Signed kernel image generic
rc  linux-image-5.8.0-53-generic                  5.8.0-53.60~20.04.1                         amd64        Signed kernel image generic
rc  linux-image-5.8.0-55-generic                  5.8.0-55.62~20.04.1                         amd64        Signed kernel image generic
rc  linux-image-5.8.0-59-generic                  5.8.0-59.66~20.04.1                         amd64        Signed kernel image generic
rc  linux-image-5.8.0-63-generic                  5.8.0-63.71~20.04.1                         amd64        Signed kernel image generic
ii  linux-image-generic-hwe-20.04* 

答案1

其中一些已被删除:

rc  linux-image-5.4.0-81-lowlatency               5.4.0-81.91                                 amd64        Signed kernel image lowlatency
rc  linux-image-5.8.0-50-generic                  5.8.0-50.56~20.04.1                         amd64        Signed kernel image generic
rc  linux-image-5.8.0-53-generic                  5.8.0-53.60~20.04.1                         amd64        Signed kernel image generic
rc  linux-image-5.8.0-55-generic                  5.8.0-55.62~20.04.1                         amd64        Signed kernel image generic
rc  linux-image-5.8.0-59-generic                  5.8.0-59.66~20.04.1                         amd64        Signed kernel image generic
rc  linux-image-5.8.0-63-generic                  5.8.0-63.71~20.04.1  

但您的系统中仍有剩余的配置文件。

解释请参见:解释

要删除已卸载软件包的剩余配置文件,请运行:

sudo apt purge $(dpkg -l | egrep '^rc' | awk '{print $2}')

解释:

  • apt purge:完全删除该包及其所有配置文件。

  • $(dpkg -l | egrep '^rc' | awk '{print $2}'):dpkg -l过滤以 开头的行rc

  • awk '{print $2}':它将打印行的第二个字段(其中包含包的名称)。

为了将来,请使用autopurge而不是autoremove,这样您就不会剩下配置文件:

sudo apt autopurge 

答案2

原因很简单:如果遇到任何问题或倒退,您实际上可以启动旧版本。虽然 Ubuntu 默认隐藏启动菜单,但您可以在实际启动之前按下一个键来查看它,然后您可以选择其他版本。

如果你输入:sudo apt-get autoremove,你的系统将允许你一次性删除所有这些软件包。如果你使用较新的 Ubuntu(例如 20.04 LTS),你也可以使用sudo apt autoremove,它们实际上是相同的东西。

您可以查看/etc/apt/apt.conf.d/01autoremove-kernelsapt 存储相关行的文件。但不要碰该文件,它是在每次安装新内核后自动生成的。

附言:ii正如 heynnema 在评论中所述,只有软件包才真正被安装。

相关内容