Apt should optimize dependencies chosen to minimize number of packages installed

Bug #181439 reported by Brian Pitts
2
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: apt

When you install a package with a dependency on package A or package B, apt may choose the package that results in the largest amount packages installed and bandwidth and disk space used.

To Replicate:

On a clean install, install latex-beamer.

Now install pdfjam.

To satisfy pdfjam's dependencies, apt should choose to install texlive-fonts-recommended This would result in 2 total packages and 26.3MB used. Instead, it chooses tetex-extra, resulting in 35 total packages and 458MB used.

Revision history for this message
TerryG (tgalati4) wrote :

Triaged to Confirmed. Apt is not the sharpest pencil in the can. Perhaps the metapackage for latex-beamer can be updated to solve this specific case. I'm sure there are other examples. Where does this get sent to make this happen?

Changed in apt:
status: New → Confirmed
Revision history for this message
Julian Andres Klode (juliank) wrote :

APT choses the first available options. This gives a predictable result. Optimization for disk space is not useful here.

Changed in apt (Ubuntu):
status: Confirmed → Invalid
Brian Pitts (bpitts)
summary: - Apt should optimize dependencies chosen to minimize disk space used
+ Apt should optimize dependencies chosen to minimize number of packages
+ installed
Revision history for this message
Brian Pitts (bpitts) wrote :

How is the first available option determined? Is it done by sorting package names alphabetically or some other criteria? Minimizing the total number of packages needed to fulfill a dependency seems like a good heuristic for apt to use to determine if it's solution integrates well with the set of packages already installed in the system. I think that behavior would be more predictable to a user than the current behavior. Of course, if this change is too complex or too low priority to even justify being placed on a feature wishlist, I understand.

Revision history for this message
Julian Andres Klode (juliank) wrote :

A depends on B or C, so APT will choose B if it is available and C is not installed. If C is installed, C is used. Packages rely on this method. Furthermore, finding the smallest solution is a much harder problem than finding the first solution, as it requires finding all solutions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.