Debian Bug report logs - #859900
apt sometimes fails to install dependencies when recommends conflict

version graph

Package: apt; Maintainer for apt is APT Development Team <[email protected]>; Source for apt is src:apt (PTS, buildd, popcon).

Affects: parl-desktop-eu, parl-desktop-world

Reported by: Andreas Beckmann <[email protected]>

Date: Sat, 8 Apr 2017 23:54:02 UTC

Severity: wishlist

Found in version apt/1.4

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], APT Development Team <[email protected]>:
Bug#859900; Package apt. (Sat, 08 Apr 2017 23:54:05 GMT) (full text, mbox, link).


Acknowledgement sent to Andreas Beckmann <[email protected]>:
New Bug report received and forwarded. Copy sent to APT Development Team <[email protected]>. (Sat, 08 Apr 2017 23:54:05 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Andreas Beckmann <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: apt: fails to install parl-desktop-world with --install-recommends
Date: Sun, 09 Apr 2017 01:51:45 +0200
Package: apt
Version: 1.4
Severity: serious
User: [email protected]
Usertags: piuparts
Control: affects -1 + parl-desktop-world parl-desktop-eu

Hi,

during a test with piuparts I noticed that parl-desktop-world could not
be tested with --install-recommends enabled.

This can be easily reproduced in a minimal chroot (where installing
Recommends is disabled by default) with

# apt-get install --install-recommends parl-desktop-world
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 parl-desktop-world : Depends: myspell-cs but it is not going to be installed
E: Unable to correct problems, you have held broken packages.


The relevant bits of the dependency chain seem to be:

Package: parl-desktop-world
Depends: icedove-l10n-cs, myspell-cs

Package: icedove-l10n-cs
Depends: thunderbird-l10n-cs

Package: thunderbird-l10n-cs
Recommends: hunspell-cs | myspell-cs-cz

Package: hunspell-cs
Conflicts: myspell-cs

Package: myspell-cs
Replaces: myspell-cs-cz
Provides: myspell-cs-cz
Conflicts: myspell-cs-cz


This command would succeed: 
# apt-get install parl-desktop-world

and this sequence would work as well:
# apt-get install myspell-cs
# apt-get install --install-recommends parl-desktop-world


I must admit that the dependencies in parl-desktop-world should be
updated, but nevertheless apt should be able to install it in its
current state.


piuparts logs if you are interested:
https://piuparts.debian.org/stretch-rcmd/fail/parl-desktop-eu_1.9.9.log
https://piuparts.debian.org/stretch-rcmd/fail/parl-desktop-world_1.9.9.log


Andreas



Added indication that 859900 affects parl-desktop-world and parl-desktop-eu Request was from Andreas Beckmann <[email protected]> to [email protected]. (Sat, 08 Apr 2017 23:54:05 GMT) (full text, mbox, link).


Information forwarded to [email protected], APT Development Team <[email protected]>:
Bug#859900; Package apt. (Mon, 10 Apr 2017 11:27:03 GMT) (full text, mbox, link).


Acknowledgement sent to Julian Andres Klode <[email protected]>:
Extra info received and forwarded to list. Copy sent to APT Development Team <[email protected]>. (Mon, 10 Apr 2017 11:27:03 GMT) (full text, mbox, link).


Message #12 received at [email protected] (full text, mbox, reply):

From: Julian Andres Klode <[email protected]>
To: Andreas Beckmann <[email protected]>, [email protected]
Subject: Re: Bug#859900: apt: fails to install parl-desktop-world with --install-recommends
Date: Mon, 10 Apr 2017 13:26:18 +0200
Control: severity -1 wishlist
Control: retitle -1 apt sometimes fails to install dependencies when recommends conflict

On Sun, Apr 09, 2017 at 01:51:45AM +0200, Andreas Beckmann wrote:
> Package: apt
> Version: 1.4
> Severity: serious
> User: [email protected]
> Usertags: piuparts
> Control: affects -1 + parl-desktop-world parl-desktop-eu
> 
> Hi,
> 
> during a test with piuparts I noticed that parl-desktop-world could not
> be tested with --install-recommends enabled.
> 
> This can be easily reproduced in a minimal chroot (where installing
> Recommends is disabled by default) with
> 
> # apt-get install --install-recommends parl-desktop-world
> Reading package lists... Done
> Building dependency tree       
> Reading state information... Done
> Some packages could not be installed. This may mean that you have
> requested an impossible situation or if you are using the unstable
> distribution that some required packages have not yet been created
> or been moved out of Incoming.
> The following information may help to resolve the situation:
> 
> The following packages have unmet dependencies:
>  parl-desktop-world : Depends: myspell-cs but it is not going to be installed
> E: Unable to correct problems, you have held broken packages.
> 
> 
> The relevant bits of the dependency chain seem to be:
> 
> Package: parl-desktop-world
> Depends: icedove-l10n-cs, myspell-cs
> 
> Package: icedove-l10n-cs
> Depends: thunderbird-l10n-cs
> 
> Package: thunderbird-l10n-cs
> Recommends: hunspell-cs | myspell-cs-cz
> 
> Package: hunspell-cs
> Conflicts: myspell-cs
> 
> Package: myspell-cs
> Replaces: myspell-cs-cz
> Provides: myspell-cs-cz
> Conflicts: myspell-cs-cz
> 
> 
> This command would succeed: 
> # apt-get install parl-desktop-world
> 
> and this sequence would work as well:
> # apt-get install myspell-cs
> # apt-get install --install-recommends parl-desktop-world
> 
> 
> I must admit that the dependencies in parl-desktop-world should be
> updated, but nevertheless apt should be able to install it in its
> current state.

APT should do a lot of things. Unfortunately, our solver is not
clever enough, and improving that is far from trivial. Hence
downgrading to wishlist ("also for any bugs that are very difficult 
to fix due to major design considerations.")

-- 
Debian Developer - deb.li/jak | jak-linux.org - free software dev
                  |  Ubuntu Core Developer |
When replying, only quote what is necessary, and write each reply
directly below the part(s) it pertains to ('inline').  Thank you.



Severity set to 'wishlist' from 'serious' Request was from Julian Andres Klode <[email protected]> to [email protected]. (Mon, 10 Apr 2017 11:27:03 GMT) (full text, mbox, link).


Changed Bug title to 'apt sometimes fails to install dependencies when recommends conflict' from 'apt: fails to install parl-desktop-world with --install-recommends'. Request was from Julian Andres Klode <[email protected]> to [email protected]. (Mon, 10 Apr 2017 11:27:03 GMT) (full text, mbox, link).


Information forwarded to [email protected], APT Development Team <[email protected]>:
Bug#859900; Package apt. (Tue, 11 Apr 2017 08:57:03 GMT) (full text, mbox, link).


Acknowledgement sent to David Kalnischkies <[email protected]>:
Extra info received and forwarded to list. Copy sent to APT Development Team <[email protected]>. (Tue, 11 Apr 2017 08:57:03 GMT) (full text, mbox, link).


Message #21 received at [email protected] (full text, mbox, reply):

From: David Kalnischkies <[email protected]>
To: Andreas Beckmann <[email protected]>, [email protected]
Subject: Re: Bug#859900: apt: fails to install parl-desktop-world with --install-recommends
Date: Tue, 11 Apr 2017 10:55:25 +0200
[Message part 1 (text/plain, inline)]
On Sun, Apr 09, 2017 at 01:51:45AM +0200, Andreas Beckmann wrote:
> The relevant bits of the dependency chain seem to be:
> 
> Package: parl-desktop-world
> Depends: icedove-l10n-cs, myspell-cs
> 
> Package: icedove-l10n-cs
> Depends: thunderbird-l10n-cs
> 
> Package: thunderbird-l10n-cs
> Recommends: hunspell-cs | myspell-cs-cz
> 
> Package: hunspell-cs
> Conflicts: myspell-cs
> 
> Package: myspell-cs
> Replaces: myspell-cs-cz
> Provides: myspell-cs-cz
> Conflicts: myspell-cs-cz

For a human that seems sensible, but if you know that apt is recursively
operating on the dependencies and/or looking at the "right" debug option
[0] you will notice that this is actually about thunderbird-l10n-cs
being found first where apt picks hunspell-cs because the first
alternative is to be preferred and at a later point stumbles over
firefox-esr-l10n-cs which recommends myspell-cs-cz (only), so ideally it
would reconsider its earlier choices at this point…

It is well-known that APT (and any greedy algorithm really) has its
problems if it must undo a decision it had formed before. APT has
various heuristics trying to allow such undos anyhow, but those fail
here as myspell-cs is considered the less favorable option…

Obviously, we could add another heuristic here making it work somehow
– that tends to add non-trivial amount of code with non-zero regression
potential (and I don't have a real idea how that heuristic would look
like).

The "simple" workaround for this specific instance is to reorder the
dependencies of parl-desktop-world as in having myspell-cs first, that
way the choice is already made at the time thunderbird-l10n-cs joins the
party and hunspell-cs is never considered.


Now, the "obvious" idea would be to have apt look at all dependencies at
once which would work in this instance – but just by "accident". If
parl-desktop-world wouldn't have a myspell-cs dependency at all we would
still have this conflict occur in distinct subtrees [1]. So the "real"
solution would include collecting in the entire tree all dependencies
which have only one solution, install all of them and so avoiding to
take decisions as long as we can. Problem here is: It is not trivial to
find how many solutions a dependencies has due to e.g. Provides and
Multi-Arch: foreign so you are quickly wasting a lot of time (ignoring
all the problems you have while collection the dependencies). From that
short paragraph alone you can guess that this is non-trivial aka not for
stretch. It is in fact basically a new resolver which we get ever so
slightly closer to cleanly switch between different ones as a first
step, but there is still quite a bit of road ahead.


Best regards

David Kalnischkies

[0] -o Debug::pkgDepCache::AutoInstall=1 -o Debug::pkgDepCache::Marker=1
[1] apt would not fail, but it still picks the hunspell-cs solution
which isn't ideal as it causes broken recommends.
[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Sun Sep 22 07:42:53 2024; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.