Using Apt-Pinning on Debian

I have returned to debian-squeeze. The reason that prompted me to return to the stable branch of Debian, (since I've always used Testing) has been the incorrect display of the typography using a kernel higher than version 2.6.32-5-686.

The main problem with taking this step is that I lose many packages that are in the repositories of Debian Testing and that debian-stable does not have. Example of them are LibreOffice 3.4.3 y Turpial.

Luckily, in Debian there is an option to Apt called Apt Pinning and you will wonder, what is that for? Well, without going into the technical grindstone, with Apt Pinning I can use debian-squeeze and at the same time, packages of debian wheezy. Cool right?

How do I do it?

After install debian-squeeze and configure it, update it and so on, the first thing I do is add the repositories of Testing, so the file /etc/apt/sources.list looks like this:

# Repositorios Stable
deb http://ftp.debian.org/debian squeeze main contrib non-free
# Repositorios Testing
deb http://ftp.debian.org/debian wheezy main contrib non-free

Later I create the file / Etc / apt / preferences and I put this inside:

Package: *
Pin: release n=stable
Pin-Priority: 900

Package: *
Pin: release n=testing
Pin-Priority: 800

Now I open a terminal update the repositories.

$ sudo apt-get update

Now when I want to install Turpial for example I have two ways to do it in terminal:

$ sudo apt-get install turpial/testing
$ sudo apt-get -t testing install turpial

Y APT it is responsible for choosing only the necessary dependencies of one repository and the other. If you want more information about this, you can visit this link.