Comment 1 for bug 508545

Revision history for this message
Stephen (kernelpanic.ca) wrote : Re: Aptitude ignores apt_preferences

I can confirm this bug. (or I am doing something completely wrong)

summary:
   I would like to install one package from karmic-proposed and all other packages from karmic, karmic-updates, or karmic-security. I added the karmic-proposed repository to sources, and a pinning block to apt/prferences.d. The command "apt-cache policy" shows the packages from karmic-proposed at a low priority. The command "apt-get upgrade" respects the priorities. The command "aptitude safe-upgrade" does not respect the priorities and attempts to upgrade all packages from karmic-proposed.

 As seen below apt-cache policy reports that the package "cups" (chosen for example) should be install/upgraded from the karmic-security archive. The command apt-get upgrade reports that all packages are up to date as expected. The command aptitude safe-upgrade attempts to install 64 news packages which goes against the policy set in apt/preferences.d/local-pin

Ubuntu: karmic
platform: amd64

All packages up to date from karmic, karmic-updates, karmic-security as of 1 Feb 2010.

Package: aptitude
Version: 0.4.11.11-1ubuntu6

Package: apt
Version: 0.7.23.1ubuntu2

/etc/apt/preferences.d/local-pin
Package: *
Pin: release a=karmic-proposed
Pin-Priority: 50

/etc/apt/sources.list
deb http://ca.archive.ubuntu.com/ubuntu/ karmic main restricted universe
deb http://ca.archive.ubuntu.com/ubuntu/ karmic-security main restricted universe
deb http://ca.archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe
deb http://ca.archive.ubuntu.com/ubuntu/ karmic multiverse
deb http://ca.archive.ubuntu.com/ubuntu/ karmic-updates multiverse
deb http://security.ubuntu.com/ubuntu karmic-security multiverse
deb http://ca.archive.ubuntu.com/ubuntu/ karmic-proposed main multiverse universe

$ apt-cache policy cups
cups:
  Installed: 1.4.1-5ubuntu2.1
  Candidate: 1.4.1-5ubuntu2.1
  Version table:
     1.4.1-5ubuntu2.2 0
         50 http://ca.archive.ubuntu.com karmic-proposed/main Packages
 *** 1.4.1-5ubuntu2.1 0
        500 http://ca.archive.ubuntu.com karmic-security/main Packages
        500 http://ca.archive.ubuntu.com karmic-updates/main Packages
        100 /var/lib/dpkg/status
     1.4.1-5ubuntu2 0
        500 http://ca.archive.ubuntu.com karmic/main Packages

$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

sudo aptitude safe-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Resolving dependencies...
Resolving dependencies...
The following NEW packages will be installed:
  linux-headers-2.6.31-18{a} linux-headers-2.6.31-18-generic{a}
  linux-image-2.6.31-18-generic{a}
The following packages will be upgraded:
  aisleriot compiz-core compiz-gnome compiz-plugins compiz-wrapper cups
  cups-bsd cups-client cups-common cups-ppdc cupsddk devicekit-power
  glchess glines gnect gnibbles gnobots2 gnome-blackjack gnome-games
  gnome-games-common gnome-mahjongg gnome-power-manager gnome-sudoku
  gnometris gnomine gnotravex gnotski grub-common gtali gtk2-engines-pixbuf
  iagno language-pack-en language-pack-gnome-en libcups2 libcupscgi1
  libcupsdriver1 libcupsimage2 libcupsmime1 libcupsppdc1 libdecoration0
  libdevkit-power-gobject1 libgail-common libgail18 libgssapi-krb5-2
  libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libk5crypto3 libkrb5-3
  libkrb5support0 libxml2 libxml2-utils linux-firmware linux-generic
  linux-headers-generic linux-image-generic linux-libc-dev mountall
  python-libxml2 python-ubuntuone-client python-ubuntuone-storageprotocol
  same-gnome ubuntuone-client ubuntuone-client-gnome
64 packages upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 82.4MB of archives. After unpacking 200MB will be used.