0

we have raspberry pi systems with debian installed, with sources from bullseye, bullseye-backports, raspberrypi, and finally our private repository. In our private repository we pre-compile zfs-modules, so that we don't have re-compile zfs-dkms on each raspberrypi box.

when apt full-upgrade is performed, and an upgrade to the package 'raspberrypi-kernel' is available but the corresponsing zfs modules package 'zfs-modules-raspi-arm64' is not yet available, apt full-upgrade elects to remove the zfs modules package. Instead it should hold the package update of raspberrypi-kernel back.

I tried pinning. I tried mark-auto/mark-manual. Holding the package 'zfs-modules-raspi-arm64' works, but also prevents normal apt upgrade operations.

Question is: how to tell apt full-upgrade, that raspberrypi-kernel should only be upgraded if zfs-modules-raspi-arm64 need not be removed for it?

Or phrased differently: How deos apt full-upgrade choose for a conflict, whether to hold the one package or remove the other?

my package dependencies (shortened):

Package: raspberrypi-kernel
Version: 1:1.20230405-1

Package: raspberrypi-kernel
Version: 1:1.20230317-1

Package: zfs-modules-raspi-arm64
Version: 2.1.9-2~~1.20230317-1
Provides: zfs-modules
Depends: raspberrypi-kernel(=1:1.20230317-1)
Conflicts: zfs-modules

apt-full-upgrade would remove zfs-modules-raspi-arm64 in order to upgrade raspberrypi-kernel. but i want apt-full-upgrade to hold raspberrypi-kernel back, until a version of zfs-modules-raspi-arm64 compiled against the new kernel version is available.

1 Answer 1

1

In short: With apt full-upgrade you explicitly ask to upgrade all packages whatever it takes. Use apt upgrade to only upgrade those which do not conflict with (do not require the removal of) any other installed package.

  • apt full-upgrade and apt-get dist-upgrade upgrade all packages even if they require the installation of additional packages or the removal of conflicting ones.
  • apt upgrade and apt-get --with-new-pkgs upgrade upgrade all packages which do not require the removal of any installed package. Those which do are skipped with some notice.
  • apt-get upgrade upgrades all packages which do neither require the installation of any additional package nor the removal of any conflicting one. Do not ask me why this inconsistency between apt and apt-get exists.

For reference the Debian man pages of both commands:

AFAIK, the only way to prevent the removal with apt full-upgrade is to apt-mark hold both packages. Otherwise APT fails if an upgrade for the unhold one is about to be applied while no upgrade for the other is available: You request an impossible operation then due to the defined conflict. But I understand that this is no practically great solution in your case, compared to just using apt upgrade.

I am not aware of a way how APT pinning can help here, which is more about which package to take from which repository, not so much about solving version conflicts, especially when they shall be persistent with ongoing version increments.


A little out of the box thinking, not strictly bound to your question but to your aim: What about hosting the kernel package on your private repository as well and update it there always together with matching ZFS module packages? Via APT pinning you could prevent any kernel upgrades from archive.raspberrypi.org to be considered.

3
  • Yes, I did consult the manpages. About apt full-upgrade and apt-get dist-upgrade they essentially only tell: > full-upgrade: > > [...] but will remove currently installed packages if this is needed to upgrade the system as a whole. > dist-upgrade: > > "smart" conflict resolution system, and it will attempt to upgrade the most important packages at the expense of less important ones if necessary. So the question remains open, why removing a package with mark-manual is a valid operation when the user requested to, as you coined it, "upgrade all packages whatever it takes". Commented Apr 17, 2023 at 16:36
  • regarding your "out of the box" comment: yes, something along the lines of this will happen in our system. However, my goal here is to make the package resilient against accidental removal. The normal operation will only call apt upgrade anyways. (and thanks about the '--with-new-pkgs', i didn't notice that apt-get upgrade was different from apt upgrade in this regard.) Commented Apr 17, 2023 at 16:38
  • apt full-upgrade and apt-get dist-upgrade are the same, AFAIK, not that "smart" but simply do it. There is no concept of more/less important packages in this context: If the upgrade of one package requires the removal of another one, those two commands will always offer/do the removal. manual/auto marks, AFAIK have no effect on upgrades, only for autoremove/autopurge. Note that this behaviour is basically required for these commands to work as intended, including actual distro upgrades (like Bullseye => Bookworm), as commonly many libraries and such are marked as manual.
    – MichaIng
    Commented Apr 20, 2023 at 11:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .