Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I changed my mind some time after install, and would prefer stable to testing for this particular system. Unfortunately, I currently have packages at old testing versions. I need to force a downgrade to get them back on the squeeze track while keeping one or two (plus dependencies) at testing versions. Sadly my preferences file isn't playing well with others. I've tried many variations on version n=, version a=, etc.

bash# cat /etc/apt/preferences.d/pinstable
Package: *
Pin: release a=testing
Pin-Priority: -10

Package: *
Pin: release a=stable
Pin-Priority: 1010

I have the default release set to stable:

bash# cat /etc/apt/preferences.d/apt.conf.d/99release
APT::Default-Release "stable";

Here's an example using a random package that has a few possible versions:

bash# apt-cache policy libapache2-mod-php5
libapache2-mod-php5:
  Installed: 5.3.6-13
  Candidate: 5.3.6-13
  Version table:
     5.3.9-1 0
        -10 http://mirror.rit.edu/debian/ testing/main i386 Packages
 *** 5.3.6-13 0
        100 /var/lib/dpkg/status
     5.3.3-7+squeeze7 0
        990 http://security.debian.org/ squeeze/updates/main i386 Packages
     5.3.3-7+squeeze3 0
        990 http://mirror.rit.edu/debian/ squeeze/main i386 Packages

Why aren't the squeeze versions at priority 1010?

share|improve this question
    
What's setting them to 990, I wonder? Is there anything in the main preferences file at /etc/apt/preferences? –  Shane Madden Feb 5 '12 at 19:18
    
@ShaneMadden nope, still nonexistent :( –  Michael Lowman Feb 5 '12 at 19:23
    
@ShaneMadden btw, realized I might have misread your comment: the default is 990 since they're in the target release. It just isn't getting overridden by the preferences file. But the preferences file is overriding the priority for testing (500 -> -10). –  Michael Lowman Feb 5 '12 at 21:33
add comment

1 Answer

up vote 3 down vote accepted

The problem here is your /etc/apt/apt.conf.d/99release file.

From man 5 apt_preferences

   If the target release has been specified then APT uses the following
   algorithm to set the priorities of the versions of a package. Assign:

   priority 990
       to the versions that are not installed and belong to the target
       release.

It appears that having an explicit release mentioned in APT will override any pin settings. I setup a test system and with a similar 99release file, and pinstable file I see the exact same values as you from apt-cache. But if I remeve the 99release file I get this.

# apt-cache policy libapache2-mod-php5
libapache2-mod-php5:
  Installed: (none)
  Candidate: 5.3.3-7+squeeze8
  Version table:
     5.3.3-7+squeeze8 0
       1010 http://security.debian.org/ squeeze/updates/main amd64 Packages
     5.3.3-7+squeeze3 0
       1010 http://ftp.us.debian.org/debian/ squeeze/main amd64 Packages
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.