Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I can't quite wrap my head around pinning in Debian. I'm trying to automatically install a package first from our local project repo, then from our local stable repo and then from official Debian repo, fulfilling dependencies as needed in the same order.

So I have three repos in /etc/apt/sources.list:

deb http://our-stable-repo/ our-squeeze-stable main
deb http://official-debian-repo/ squeeze main
deb http://our-project-repo/ our-project main

Release files are as follows, our-stable-repo:

Origin: Ourname
Label: Ourname
Suite: our-squeeze-stable
Components: backports main
Architectures:  
MD5Sum:
 [...]
SHA1:
 [...]

and our-project-repo:

Origin: Ourname
Label: Ourname
Archive: our-project
Component: main
Architecture: amd64

All our packages are in our-stable-repo and our-project-repo. I want to test a package from our-project-repo, which will have few dependencies from the same, and some (those which are not to be tested) from our-stable-repo.

Now I set up my /etc/apt/preferences:

Package: *
Pin: release a=our-project
Pin-Priority: 900

Package: *
Pin: release a=our-squeeze-stable
Pin-Priority: 750

Package: *
Pin: release a=squeeze
Pin-Priority: 600

so I expect apt to try and install any package from our-project first.

But that does not happen; our-our-squeeze-stable seems to always "win". And even providing -t our-project on a command line does not help. Only way how I was able to make apt install my package from the project repo was removing other sources, but that way I ended up with broken dependencies.

I tried to debug with apt-cache policy, but that's even more confusing:

root@test:~# apt-cache policy
Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://our-project-repo/ our-project/main amd64 Packages
     origin our-project-repo
 500 http://official-debian-repo/debian-security/ squeeze/updates/non-free amd64 Packages
     release v=6.0,o=Debian,a=oldstable,n=squeeze,l=Debian-Security,c=non-free
     origin official-debian-repo
 500 http://official-debian-repo/debian-security/ squeeze/updates/contrib amd64 Packages
     release v=6.0,o=Debian,a=oldstable,n=squeeze,l=Debian-Security,c=contrib
     origin official-debian-repo
 500 http://official-debian-repo/debian-security/ squeeze/updates/main amd64 Packages
     release v=6.0,o=Debian,a=oldstable,n=squeeze,l=Debian-Security,c=main
     origin official-debian-repo
 500 http://official-debian-repo/debian/ squeeze/non-free amd64 Packages
     release v=6.0.7,o=Debian,a=oldstable,n=squeeze,l=Debian,c=non-free
     origin official-debian-repo
 500 http://official-debian-repo/debian/ squeeze/contrib amd64 Packages
     release v=6.0.7,o=Debian,a=oldstable,n=squeeze,l=Debian,c=contrib
     origin official-debian-repo
 500 http://official-debian-repo/debian/ squeeze/main amd64 Packages
     release v=6.0.7,o=Debian,a=oldstable,n=squeeze,l=Debian,c=main
     origin official-debian-repo
 750 http://our-stable-repo/ our-squeeze-stable/main amd64 Packages
     release o=Ourname,a=our-squeeze-stable,l=Ourname,c=main
     origin our-stable-repo
Pinned packages:
root@test:~# 

Why in this apt-cache policy output the project repo has still 500?

Is there something wrong with this setup?

share|improve this question
    
Did you run apt-get update after changing preferences? If our-project has older package versions than our-squeeze-stable, then you need a pin over over 1000, otherwise, you don't need adjusted pinning at all. –  jordanm Jul 29 '13 at 14:16
    
@jordanm you don't need to run apt-get update after changing preferences –  derobert Jul 29 '13 at 14:36

1 Answer 1

 500 http://our-project-repo/ our-project/main amd64 Packages
     origin our-project-repo

Note the lack of a release line. That's important, because you're trying to set a pin on a release field. Most likely, you don't have a proper Release file in your archive (or, at least, it doesn't have the fields set).

Not sure what you're using to maintain your package archive, but (e.g.,) for mini-dinstall, you need to set the release_* config options. You can check in /var/lib/apt/lists to find the current release file apt-get has for your archive (if any). If you watch an apt-get update closely, you can see it downloading (or failing to download) the release file as well as related stuff (like Release.gpg, the signature for the release file).

If you can't fix your release file, set a pin on the origin instead:

Package: *
Pin: origin "our-project-repo"
Pin-Priority: 900
share|improve this answer
    
Can I see the Release file without need to ssh to the repo host? I guess it should be cached somewhere after apt-get update but I can't seem to find it. Or I could just wget it -O - if I could mount the URI...? –  Alois Mahdal Jul 29 '13 at 15:03
    
@AloisMahdal Its in /var/lib/apt/lists (if it exists). Or you can grab it however apt would; e.g., http.us.debian.org/debian/dists/wheezy/main/binary-amd64/… is one from Wheezy. Substitute in your repository and path. –  derobert Jul 29 '13 at 15:07

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.