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?
apt-get updateafter changing preferences? Ifour-projecthas older package versions thanour-squeeze-stable, then you need a pin over over 1000, otherwise, you don't need adjusted pinning at all.