![即使依赖包被删除或重命名,如何让 apt 自动升级包?](https://linux22.com/image/1208315/%E5%8D%B3%E4%BD%BF%E4%BE%9D%E8%B5%96%E5%8C%85%E8%A2%AB%E5%88%A0%E9%99%A4%E6%88%96%E9%87%8D%E5%91%BD%E5%90%8D%EF%BC%8C%E5%A6%82%E4%BD%95%E8%AE%A9%20apt%20%E8%87%AA%E5%8A%A8%E5%8D%87%E7%BA%A7%E5%8C%85%EF%BC%9F.png)
常规的 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.
...