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 maindeb http://official-debian-repo/ squeeze maindeb http://our-project-repo/ our-project mainRelease files are as follows, our-stable-repo:Origin: OurnameLabel: OurnameSuite: our-squeeze-stableComponents: backports mainArchitectures:  MD5Sum: [...]SHA1: [...]and our-project-repo:Origin: OurnameLabel: OurnameArchive: our-projectComponent: mainArchitecture: amd64All 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-projectPin-Priority: 900Package: *Pin: release a=our-squeeze-stablePin-Priority: 750Package: *Pin: release a=squeezePin-Priority: 600so 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 policyPackage 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-repoPinned packages:root@test:~# Why in this apt-cache policy output the project repo has still 500?Is there something wrong with this setup?
Pinning and local repos
debian;apt;repository
 500 http://our-project-repo/ our-project/main amd64 Packages     origin our-project-repoNote 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-repoPin-Priority: 900