On Tue, Jan 02, 2024 at 06:05:03PM +0300, Askar Safin wrote:
> It follows from my interpretation of the phrase "Subject to
> dependency constraints" from "man apt_preferences", that
> first apt should exclude logically inconsistent solutions. So it

I understand what you mean, but that isn't the intended interpretation
– at least not in the universal applicability you want it to have.

Imagine this:
Package: foo-a
Depends: bar (>= 2)

Package: foo-b
Depends: bar (<= 1)

If logical exclusion would really be our fist principle here bar is
likely to flip-flop happily between version 1 and 2 depending on which
foo the user has most recently "forced" upon the system and the upgrade
state is at least in doubt:
An old, outdated, potentially dropped from Debian, foo-b is holding
back bar for all of eternity due to "dependency constraints".
Hopefully bar isn't server software with giant security bugs…

apts strategy to avoid this and similar problems is to pick an
installation candidate for all packages before its considering if it
has to install anything at all. This is what preferences is all about,
defining which version will get to be the candidate. Other strategies
exist with their own set of shortcomings as finding a solution is not
in general the same as finding a user-acceptable solution.

All that small incomplete sentence in the summary section of the manpage
provides is that a solver *might* deviate from installing the highest
version. It would be subject to dependency constraints to not install
any version, too (compare e.g. also apt keeping back packages).

Subject to parking regulations, you can park everywhere. If you park
your car in an area not for parking you are subject to a fine – if you
are spotted and the officer feels like it. Nothing guarantees you that
you will be fined nor that the officer is subject to provide help to
you to find a parking spot. They might do it anyhow if you ask nicely.
It is dangerous to read too much into a few weak words.


Things like "apt build-dep foo/stretch-backports" exist which can change
the candidate based on version constraints. Other solvers like aptitudes
default one (or as said the ascpud solver usually tasked with backports)
might be more willing to offer such solutions than apts default solver
in general. It is a choice with (in general) non-trivial non-binary
answer(s).


Best regards

David Kalnischkies

P.S.: True, seems like I mixed up stretch and squeeze – don't know how
that happened… stretch actually has (external) ELTS support still.
On the upside, you can use most of the things I hinted at and that
Johannes has pointed you to as well now.

Attachment: signature.asc
Description: PGP signature

Reply via email to