Normal unattended-upgrades keeps back packages when a Depends
package is removed/renamed. This is usually reasonable, but I would like to override this behavior, as it can lead to breakage which can be hard to detect/fix if it occurs in a cloud virtual machine that one isn't regularly interacting with. Is it possible to tell unattended-upgrades to not keep back such packages? (Note: I am not asking about phased upgrades.)
Specifically I had dotnet-runtime-7.0
auto-upgrade to a newer version while dotnet-hostfxr-7.0
was kept back due to one of its Depends
being renamed. This broke dotnet
and applications using the runtime as dotnet
could no longer find the runtime (dotnet --list-runtimes
returned nothing). While correcting this manually, I had the following output:
$ 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.
...