pinning negative preferences not preventing installation

Bug #185692 reported by Matt LaPlante
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: apt

I'm not sure if this is a problem with the documentation, or a problem with the application, however apt is not behaving as expected when pinning negative values.

According to man 5 apt_preferences, a Pin-Priority "P < 0 prevents the version from being installed."

Now I'll take a package at random and pin it in /etc/apt/preferences:
Package: python-tcm
Pin: version 0.5.1-0ubuntu4
Pin-Priority: -100

And yet, the package attempts to install:

root@prizm:/tmp# apt-get -Vs install python-tcm
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
   pessulus (2.16.3-0ubuntu1)
   python-tcm (0.5.1-0ubuntu4)
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Inst python-tcm (0.5.1-0ubuntu4 Ubuntu:7.10/gutsy)
Conf python-tcm (0.5.1-0ubuntu4 Ubuntu:7.10/gutsy)

The same occurs with a generalized version (Pin: version *).

Revision history for this message
Jisakiel (jisakiel) wrote :

I found a similar problem and I was going to report it here also; it wasn't working with "release a=unstable" and pins for debian repositories...

Finally I found the debian mirror I was using was missing the Release files in /var/lib/apt/lists and therefore the release wasn't being applied; does not seem to be your case, but I'd double check there, and perhaps would try as well changing mirrors, just in case...

Revision history for this message
Mumia W. (mumia-w-18) wrote :

I also have this problem with apt 0.7.9ubuntu17 on Ubuntu Hardy Heron. Pinning does not work as documented in "man apt_preferences"; I don't want to install a buggy/vulnerable version of libimlib2, so I pinned it this way:

---file:/etc/apt/preferences---
Package: libimlib2
Pin: version 1.4.0-1ubuntu1
Pin-Priority: -10
-------------end---------------

However, this failed to have any effect on the package's priority:

----------------------
$ apt-cache policy libimlib2
libimlib2:
  Installed: (none)
  Candidate: 1.4.0-1ubuntu1
  Package pin: 1.4.0-1ubuntu1
  Version table:
     1.4.0-1ubuntu1 -10
        500 http://us.archive.ubuntu.com hardy/main Packages
----------------------

In previous versions of apt, the changed priority (-10) would be listed where the 500 is listed in the above output. Attempts to install a package requiring that library may well bring in the buggy library:

-------------------------------------
:$ sudo apt-get -s install pypanel
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libid3tag0 libimlib2 python-xlib
The following NEW packages will be installed:
  libid3tag0 libimlib2 pypanel python-xlib
0 upgraded, 4 newly installed, 0 to remove and 8 not upgraded.
Inst libid3tag0 (0.15.1b-10 Ubuntu:8.04/hardy)
Inst libimlib2 (1.4.0-1ubuntu1 Ubuntu:8.04/hardy)
Inst python-xlib (0.14-1 Ubuntu:8.04/hardy)
Inst pypanel (2.4-1.1build1 Ubuntu:8.04/hardy)
Conf libid3tag0 (0.15.1b-10 Ubuntu:8.04/hardy)
Conf libimlib2 (1.4.0-1ubuntu1 Ubuntu:8.04/hardy)
Conf python-xlib (0.14-1 Ubuntu:8.04/hardy)
Conf pypanel (2.4-1.1build1 Ubuntu:8.04/hardy)
-------------------------------------

Pinning does not work as described in "man apt_preferences," so there is a bug in apt.

Changed in apt:
status: New → Confirmed
Revision history for this message
Marco Paolini (mpaolini) wrote :

this does not look like a duplicate of bug #565364

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

It is a duplicate, just maybe with a different effect. Anyway fixed over a year ago in 16.04, no need to bring that up again.

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.