[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#825113: apt: APT's specific preference affects all available versions



On Tue, May 24, 2016 at 03:54:41PM +0300, Александр Цамутали wrote:
> On 23.05.2016 22:19, Adam D. Barratt wrote:
> > On Mon, 2016-05-23 at 18:49 +0000, Alexander Tsamutali wrote:
> > > root@ed69a0989664:/etc/apt# cat preferences.d/xscreensaver
> > > Package: xscreensaver
> > > Pin: origin n=jessie-updates
> > > Pin-Priority: -1
> > 
> > That's not a valid pin definition. "origin" is a hostname, you want
> > "Pin: release n=jessie-updates".
> 
> Sorry for the typo, here is correct version:
> 
> root@ed69a0989664:/etc/apt# cat preferences.d/xscreensaver
> Package: xscreensaver
> Pin: release n=jessie-updates
> Pin-Priority: -1
> root@ed69a0989664:/etc/apt# apt-cache policy
> Package files:
>  100 /var/lib/dpkg/status
>      release a=now
>  500 http://security.debian.org/ jessie/updates/main amd64 Packages
>      release v=8,o=Debian,a=stable,n=jessie,l=Debian-Security,c=main
>      origin security.debian.org
>  500 http://httpredir.debian.org/debian/ jessie-updates/main amd64 Packages
>      release o=Debian,a=stable-updates,n=jessie-updates,l=Debian,c=main
>      origin httpredir.debian.org
>  500 http://httpredir.debian.org/debian/ jessie/main amd64 Packages
>      release v=8.4,o=Debian,a=stable,n=jessie,l=Debian,c=main
>      origin httpredir.debian.org
> Pinned packages:
>      xscreensaver -> 5.30-1+deb8u2
> root@ed69a0989664:/etc/apt# apt-cache policy xscreensaver
> xscreensaver:
>   Installed: (none)
>   Candidate: (none)
>   Package pin: 5.30-1+deb8u2
>   Version table:
>      5.30-1+deb8u2 -1
>         500 http://httpredir.debian.org/debian/ jessie-updates/main amd64
> Packages
>      5.30-1+deb8u1 -1
>         500 http://httpredir.debian.org/debian/ jessie/main amd64 Packages
>         500 http://security.debian.org/ jessie/updates/main amd64 Packages
> root@ed69a0989664:/etc/apt# apt-get install -s xscreensaver > /dev/null ;
> echo $?
> E: Package 'xscreensaver' has no installation candidate
> 100
> 

It's "expected" (for some value of expected), the pre-1.1 engine does not deal
well with -1 pins; in contrast to the 1.1 and newer engine used in testing,
unstable, experimental.

The reason here is that in the pre-1.1 engine, a package can have exactly one
pin. This pin must match the candidate version for it to be useful. As a work
around, you can probably pin the other versions above 1000.

In 1.1 and newer, packages have no pins. Instead, versions have pins. So, in your
case, you'd get:

xscreensaver:
  Installed: (none)
  Candidate: 5.30-1+deb8u1
  Version table:
     5.30-1+deb8u2 -1
        500 http://httpredir.debian.org/debian/ jessie-updates/main amd64 Packages
     5.30-1+deb8u1 500
        500 http://httpredir.debian.org/debian/ jessie/main amd64 Packages
        500 http://security.debian.org/ jessie/updates/main amd64 Packages

That said, it's ridiculous to blacklist the fixed xscreensaver version.

Anyway, that's one of the many problems fixed in 1.1, so you'll be happy in the
next Debian release (unfortunately, the new pinning engine is too invasive to
bring to older APT versions).

-- 
Debian Developer - deb.li/jak | jak-linux.org - free software dev

When replying, only quote what is necessary, and write each reply
directly below the part(s) it pertains to (`inline'). Thank you.


Reply to: