我做了一些挖掘,发现内核的自动清理功能已启用/etc/kernel/postinst.d/apt-auto-removal
并且文件状态:
# In the common case this results in two kernels saved (booted into the
# second-latest kernel, we install the latest kernel in an upgrade), but
# can save up to four. Kernel refers here to a distinct release, which can
# potentially be installed in multiple flavours counting as one kernel.
但是该脚本超出了我的想象,除了最后 4 个内核之外,我无法轻松找到如何自动清理任何内容。
当它说“最多四个”时,它的意思是当前运行的、当前安装的、最新的和以前的版本都可能不同,从而导致自动保留四个版本(至少两个)。请参阅这部分代码:
我认为让它保存旧内核的最简单方法是将其扩展
$previous_version
到一个列表。代替:做: