即使依赖包被删除或重命名,如何让 apt 自动升级包?

即使依赖包被删除或重命名,如何让 apt 自动升级包?

常规的 unattended-upgrades 会在删除/重命名包时保留包Depends。这通常是合理的,但我想覆盖此行为,因为它可能会导致难以检测/修复的损坏,如果它发生在不经常与之交互的云虚拟机中。是否可以告诉 unattended-upgrades 不要保留此类包?(注意:我不是询问分阶段升级的情况。

具体来说,我曾dotnet-runtime-7.0自动升级到较新的版本,但dotnet-hostfxr-7.0由于其中一个版本Depends被重命名而无法使用。这导致dotnet使用该运行时的应用程序dotnet无法再找到该运行时(dotnet --list-runtimes未返回任何内容)。在手动更正此问题时,我得到了以下输出:

$ sudo apt upgrade aspnetcore-runtime-7.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
aspnetcore-runtime-7.0 is already the newest version (7.0.109-0ubuntu1~22.04.1).
Calculating upgrade... Done
The following packages have been kept back:
  dotnet-host dotnet-hostfxr-7.0
...
$ sudo apt upgrade dotnet-hostfxr-7.0
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be REMOVED:
  dotnet-host
The following NEW packages will be installed:
  dotnet-host-7.0
The following packages will be upgraded:
  dotnet-hostfxr-7.0
1 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
1 standard LTS security update
Need to get 342 kB of archives.
...

相关内容