1

This is how my /etc/apt/sources.list looks like on Debian 8.1:

#### stable  #########
deb http://httpredir.debian.org/debian stable main contrib non-free
deb-src http://httpredir.debian.org/debian stable main contrib non-free
deb http://httpredir.debian.org/debian stable-backports main contrib non-free
deb-src http://httpredir.debian.org/debian stable-backports main contrib non-free
deb http://httpredir.debian.org/debian stable-updates main contrib non-free
deb-src http://httpredir.debian.org/debian stable-updates main contrib non-free
deb http://security.debian.org stable/updates main contrib non-free
deb-src http://security.debian.org stable/updates main contrib non-free
#### unstable #########
deb http://httpredir.debian.org/debian unstable main contrib non-free
deb-src http://httpredir.debian.org/debian unstable main contrib non-free

This is how my /etc/apt/preferences looks like:

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

My question is, what is the scenario when I install foo 1.9.2 with $ sudo apt-get -y -t unstable install foo and in the future, the stable channel getting a newer version, for example 1.9.5? Will my app (and all of its dependencies) be updated when I do this command?

$ apt-get -y update && time apt-get -y dist-upgrade

UPDATE:

This is the nginx website suggested install method. This will upgrade two packages from unstable source, same to my method:

/etc/apt/sources.list.d/nginx.list

deb http://nginx.org/packages/mainline/debian/ jessie nginx
deb-src http://nginx.org/packages/mainline/debian/ jessie nginx

/etc/apt/preferences

Package: *
Pin: release a=nginx
Pin-Priority: 900

.

The following packages will be upgraded: libssl1.0.0 perl-base

libssl1.0.0 (1.0.2c-1 Debian:unstable [amd64])
perl-base [5.20.2-3+deb8u1] (5.20.2-6 Debian:unstable [amd64])

My method gives me the opportunity for other apps. The nginx way only upgrading nginx, plus preferences file needing plus lines.

  • 1
    This is how you trash a Debian system. – jordanm Jun 28 '15 at 22:38
  • Can You explain why? – Lanti Jun 29 '15 at 7:07
1

With this pin, a version from unstable will never be installed unless you explicitly request it. For example, if 1.9.2 from unstable is currently installed, and unstable now has 1.9.5, apt-get upgrade will not upgrade the package.

If the version in stable changes, it will be installed provided that it's newer than the installed version. If 1.9.5 enters stable, it will be installed. But if stable is upgraded from 1.8.1 to 1.8.2, 1.8.2 won't be installed on your system (again, except by explicit request). Apt will not automatically downgrade unless the older version has a priority above 1000, regardless of the priority of the version that was installed — when a package is installed, the installed version has a priority of 500 regardless of how it was installed.

The same goes for dependencies. If 1.9.5 enters unstable and you explicitly request its installation, then the package will be upgraded to 1.9.5, but only if dependencies are satisfied by what's already installed (or packages from stable), otherwise apt will complain about unresolved dependencies. If the newer version depends on the newer version of another package from unstable, the other package will only be installed by explicit request too.

| improve this answer | |
  • Thank You for your clarification! The reason why I putted unstable in the source list at pin -1, because I just want an option to install for example nginx latest, that's currently in the testing and unstable channels only and I don't want to build it from source, plus I don't want unstable source list to interfere with regular updates either. – Lanti Jun 29 '15 at 7:17
  • @user1442219 If you know what package you want from unstable, pin that package only: Package: nginx. But that won't work for long, at some point it'll start requiring a newer libc, and if you upgrade the libc you'll practically end up having unstable. When that happens, switch to recompiling the package from unstable against the libraries in stable (if someone hasn't done that already). – Gilles 'SO- stop being evil' Jun 29 '15 at 7:26
  • So you saying that my backports lines practically doing the same thing what I want, but from the testing release, not from the unstable? If I run this: $ apt-get -t jessie-backports install "package" I will get eg. nginx from the testing channel? How this interfere with making my stable Debian to testing release, partly? Same applies here, too? – Lanti Jun 29 '15 at 7:57
  • @user1442219 Only if somebody has uploaded the package to the backports. It's done manually, partly based on user requests. – Gilles 'SO- stop being evil' Jun 29 '15 at 8:00
  • Thank You! I think I keep the unstable in. If I need something really up-to-date, than I have the option. If I don't need this, than those lines never get used. Probably I never use backports, so I think I can remove from my source.list. – Lanti Jun 29 '15 at 8:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.