Selective install of debian testing packages

From snippet wiki
Jump to navigation Jump to search

In need of a bleading edge feature like http/2 for your stable debain server? Try this:

Create a file /etc/apt/sources.list.d/testing.list

deb http://ftp.de.debian.org/debian/ testing main contrib non-free
deb http://ftp.de.debian.org/debian/ unstable main contrib non-free
deb http://security.debian.org/ testing/updates main contrib

And create /etc/apt/preferences.d/testing

Package: *
Pin: release a=testing
Pin-Priority: -1

Package: *
Pin: release a=unstable
Pin-Priority: -1

Verify it using:

apt-get update
apt-cache policy

Your policy should give -1 as the output values for all non-stable packages. So by default an upgrade command will install nothing new.

Now you can install selective packages including their dependencies:

apt-get -t testing install apache2

Or for even newer packages:

apt-get -t unstable install apache2
a2enmod http2
service apache2 restart