Home My Page Projects Dose: library and tools
Summary Activity Tracker Lists SCM Files

[#14979] apt-cudf: translation of dist-upgrade does not allow to remove packages

Date:
2012-10-16 15:43
Priority:
3
State:
Open
Submitted by:
Ralf Treinen (treinen)
Assigned to:
Ralf Treinen (treinen)
Summary:
apt-cudf: translation of dist-upgrade does not allow to remove packages

Detailed description
The CUDF document generated from a dist-upgrade command contains a CUDF
upgrade request for all currently installed packages. As a consequence,
an external solver is not allowed to remove any packages in reply to
a dist-upgrade. This is too conservative, as apt-get dist-upgrade with the
build-in solver does remove packages.

The first question is of course to find the right criterion that allows for the removal of packages.
Message  ↓
Date: 2014-04-09 20:55
Sender: Roberto Di Cosmo

Right... what about this alternative:

Encode upgrade with

Install: <empty>

optimisation function

-count(new),-count(removed),-notuptodate(solution),-count(down)

Encode upgrade with

Install: <empty>

optimisation function

-count(removed),-notuptodate(solution),-count(down)

But I agree that this will not be equivalent to finely
controlling which package you want to give precedence to.

Date: 2014-04-09 16:08
Sender: Ralf Treinen

Allowing for downgrades is not sufficient. "apt-get dist-upgrade" might even decide to remove a package, for instance if upgrading a package (that you had previously explicitely demanded to install) requires installing a new library packages that conflicts with some other library package. Apt-get applies some heuristics to determine when a package may be removed, but this heuristics is burried somewhere in tons of C++ code ...

BTW: recent apt-get features new options that provide a finer control than what was previously possible about
what an upgrade or dist-upgrade is allowed to do: --with-new-pkgs, --no-upgrade, -- only-upgrade, etc. See apt-get (1). Might be interesting to
integrate these into apt-cudf if it isn't already done.

-Ralf.

Date: 2014-04-09 15:37
Sender: Roberto Di Cosmo

Using aspcud, this can be approximated by turning the list of installed packages into an Install request (instead of Upgrade, that prevents downgrades), and using an optimization criteria which could be

-notuptodate(solution),-count(down)

On the other hand, if we want to simulate "apt-get upgrade", which is prevented from installing new packages, we could use

-count(new),-notuptodate(solution),-count(down)

Any feedback on this proposal?

No Changes Have Been Made to This Item