On Sun, Dec 13, 2009 at 03:57:27PM +1100, Gordon Wrigley wrote:
> >> Another way to look at this would be to ask...
> >>
> >> Given two available versions of a package where the higher version has
> >> the lower priority, how do I get apt to automatically install the
> >> lower priority one when the higher version is required to meet a
> >> dependency?
> >
> > If the higher version is required to meet a dependency, why don't you
> > want it installed?
> 
> Sorry I wasn't clear enough with priority and version, an example might help.
> 
> Imagine we are trying to install package Bob from testing with
> "apt-get install bob/testing".
> Package Bob depends on package Fred with version >= 1.1
> 
> We have these two candidates for package Fred:
> stable, priority 500, version 1.0
> testing, priority 400, version 1.1
> 
> And Apt says:
> 
> The following packages have unmet dependencies:
>   bob: Depends: fred but it is not going to be installed
> 
> As I understand it this is because it chose the priority 500 version
> which isn't sufficient to meet the dependency.
> 
That is the way the docs say it should work, if I understand correctly.
apt-get install bob/testing means to install "bob" from testing, but do
not install any dependencies from testing -- try to meet dependencies
from the highest pin priority.

"apt-get install -t testing bob" means to install "bob" from testing,
and install any dependencies from testing as well.

Suppose "bob" also depends on "sam" (any version), and "sam" is in both the
stable and testing repos.  I don't think there is an automated way to
apt-get install bob, while pulling in "sam" from stable and "fred" from
testing.  Somebody correct me if I'm wrong.

> > Apt is going to try to meet the dependency.
> 
> I wish it would, but it doesn't and I can't figure out what I'm doing wrong.
> As far as I can see it ALWAYS goes for the the higher priority version
> even if that won't meet the dependency.
> 
"apt-get install -t testing bob" would work on my Debian Lenny system.
However, I don't have stable and testing pinned in preferences.  I have in my 
apt.conf:
APT::Default-Release "stable";

This effectively pins stable to 990.

I also tend to use aptitude.  I wonder if it'll behave any differently
if you use aptitude instead of apt-get.

In case you're not aware, "man apt_preferences" is where you can find a
lot of info on pinning and priorities.

-Rob


-- 
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org 
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to