I am configuring a Debian 6 (Squeeze) x86 server, and want to install some packages from testing or unstable when needed, so I'm using pinning.
I have configured my /etc/apt/sources.list as follow:
deb http://ftp.br.debian.org/debian stable main
deb http://ftp.br.debian.org/debian stable-updates main
deb http://security.debian.org/ stable/updates main
deb http://backports.debian.org/debian-backports squeeze-backports main
deb http://ftp.br.debian.org/debian testing main
deb http://ftp.br.debian.org/debian testing-updates main
deb http://security.debian.org/ testing/updates main
deb http://ftp.br.debian.org/debian unstable main
And my /etc/apt/preferences as follow:
Package: *
Pin: release a=stable
Pin-Priority: 700
Package: *
Pin: release a=stable-updates
Pin-Priority: 700
Package: *
Pin: release a=squeeze-backports
Pin-Priority: 675
Package: *
Pin: release a=testing
Pin-Priority: 650
Package: *
Pin: release a=testing-updates
Pin-Priority: 650
Package: *
Pin: release a=unstable
Pin-Priority: 600
Executing apt-cache policy, I get:
100 /var/lib/dpkg/status
release a=now
600 http://ftp.br.debian.org/debian/ unstable/main i386 Packages
release o=Debian,a=unstable,n=sid,l=Debian,c=main
origin ftp.br.debian.org
650 http://security.debian.org/ testing/updates/main i386 Packages
release o=Debian,a=testing,n=wheezy,l=Debian-Security,c=main
origin security.debian.org
650 http://ftp.br.debian.org/debian/ testing-updates/main i386 Packages
release o=Debian,a=testing-updates,n=wheezy-updates,l=Debian,c=main
origin ftp.br.debian.org
650 http://ftp.br.debian.org/debian/ testing/main i386 Packages
release o=Debian,a=testing,n=wheezy,l=Debian,c=main
origin ftp.br.debian.org
675 http://backports.debian.org/debian-backports/ squeeze-backports/main i386 Packages
release o=Debian Backports,a=squeeze-backports,n=squeeze-backports,l=Debian Backports,c=main
origin backports.debian.org
700 http://security.debian.org/ stable/updates/main i386 Packages
release v=6.0,o=Debian,a=stable,n=squeeze,l=Debian-Security,c=main
origin security.debian.org
700 http://ftp.br.debian.org/debian/ stable-updates/main i386 Packages
release o=Debian,a=stable-updates,n=squeeze-updates,l=Debian,c=main
origin ftp.br.debian.org
700 http://ftp.br.debian.org/debian/ stable/main i386 Packages
release v=6.0.6,o=Debian,a=stable,n=squeeze,l=Debian,c=main
origin ftp.br.debian.org
The problem I'm facing is that when I try to install some packages from testing. Ex:
apt-get install ruby1.9.1-dev/testing
I get a broken package message:
The following packages have broken dependencies:
ruby1.9.1-dev : Depends: libruby1.9.1 (= 1.9.3.194-5) but 1.9.2.0-2 is set to be installed
E: Broken Packages
This means I want to install from testing but Debian tries to install dependencies from stable. I know I can do:
apt-get install -t testing ruby1.9.1-dev
It works by installing all dependencies from testing, but I want to use the maximum possible the stable packages (install deps from stable if available).
Another problem I'm having is, if I install a package like this:
apt-get install -t testing ruby1.9.1-dev
And then try to install another package that depends on a library that was installed as a dependency of ruby1.9.1-dev from testing:
apt-get install gcc
I also get the Broken Packages error.
So the questions are:
How can I install a package from testing, but also install the maximum of dependencies possible from stable?
Is it possible to automatically install a package from testing when it is not available in stable by just running
apt-get install package_name
?