apt wants to downgrade packages with pin-priority less than 1000
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
apt (Debian) |
New
|
Unknown
|
|||
apt (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: apt
== Summary ==
apt will attempt to downgrade an installed package if the pin-priority of the package is greater than 99.
apt will not downgrade when pin-priorty is 99 or below because the already installed package automatically gets a priority of 100.
According to the apt_preferences manpage (mentioned several times), apt will *never* downgrade a package unless the priority of an available version exceeds 1000.
== Details ==
My testing system:
Ubuntu 8.04.1 (Hardy)
apt 0.7.9ubuntu17.1 for i386 compiled on Oct 27 2008 18:11:08
Reproducing the issue is simple, as described below (I have chosen base-files as its a small package without any build-deps, but any package will do).
# dpkg -s base-files |grep Version
Version: 4.0.1ubuntu5.8.04.3
# grep deb-src /etc/apt/
deb-src http://
# apt-get source base-files
dpkg-source: extracting base-files in base-files-
dpkg-source: unpacking base-files_
# head debian/changelog
base-files (4.0.1ubuntu5.
* testing pinning issue
-- Alon Swartz <email address hidden> Tue, 06 Jan 2009 00:00:00 +0000
# dpkg-buildpackage -b -tc
# dpkg -i base-files_
Setting up base-files (4.0.1ubuntu5.
# dpkg -s base-files |grep Version
Version: 4.0.1ubuntu5.
# cat > /etc/apt/
Package: base-files
Pin: release o=Ubuntu
Pin-Priority: 999
EOF
Note: the pin-priority can be anything larger than 99 to reproduce this
# apt-cache policy base-files
base-files:
Installed: 4.0.1ubuntu5.
Candidate: 4.0.1ubuntu5.8.04.3
Package pin: 4.0.1ubuntu5.8.04.3
Version table:
*** 4.0.1ubuntu5.
100 /var/lib/
4.
500 http://
4.0.1ubuntu5 999
500 http://
# apt-get install base-files
The following packages will be DOWNGRADED:
base-files
In other words, apt wants to downgrade a package even though the pin-priority is less than 1000, which goes against all the
documentation.
Is this a bug in apt, a bug in the documentation, or am I mis-understanding something?
Changed in apt (Debian): | |
status: | Unknown → New |
That's an interestingly weird bug. Confirmed on karmic (apt 0.7.21ubuntu1).
It is specific to using a "Package: name" pin. A "Package: *" pin does not reproduce the bug.