2

I've followed the instructions on debian-handbook.info/browse/stable/apt.html (and the page linked there) which basically say to put the following text in /etc/apt/sources.list

# Unstable
deb http://ftp.debian.org/debian unstable main contrib non-free
deb-src http://ftp.debian.org/debian unstable main contrib non-free

# Testing
deb http://ftp.debian.org/debian testing main contrib non-free
deb-src http://ftp.debian.org/debian testing main contrib non-free

# Stable
deb http://ftp.debian.org/debian stable main contrib non-free
deb-src http://ftp.debian.org/debian stable main contrib non-free

# Security updates
deb http://security.debian.org/ stable/updates main contrib non-free
deb http://security.debian.org/ testing/updates main contrib non-free
deb-src http://security.debian.org/ stable/updates main contrib non-free
deb-src http://security.debian.org/ testing/updates main contrib non-free

Then add APT::Default-Release "testing"; to /etc/apt/apt.conf.d/local to download only the packages in Testing.
Well, it didn't work.
I also tried adding APT::Default-Release "testing"; to /etc/apt/apt.conf.d/70debconf as suggested at https://wiki.debian.org/AptConf but apt dist-upgrade still wanted to install Unstable's pakages.

5
  • is it installing all packages from unstable or just some? if you've already installed unstable packages later than what's in testing, apt-get won't downgrade anything. and if you have already installed a newer version of a package (e.g. a library) from unstable than what is available in testing, then apt-get will only install dependent packages from testing if they don't conflict with the installed (unstable) version of the package.
    – cas
    Apr 21, 2016 at 12:11
  • eventually (in around two weeks) testing will have caught up to unstable for most packages, so this issue will mostly go away. BTW, always test an upgrade or install by using apt-get's -d -u or -V -d -u options. e.g. apt-get -d -u install pkg or apt-get -V -d -u dist-upgrade. Remove those options when you're sure it's going to install what you want.
    – cas
    Apr 21, 2016 at 12:12
  • @cas I ran apt list --upgradable after an apt update, for every package I got packagename/unstable,testing version .... The versions were actually those of packages in Sid. Apr 21, 2016 at 15:23
  • Please supply the output of apt-cache policy and apt-cache policy PACKAGE where PACKAGE is the name of a package that you'd expect a different candidate version of. Apr 21, 2016 at 20:44
  • @FerencWágner see my answer. Thanks for the interest :-) Apr 24, 2016 at 20:23

2 Answers 2

2

To install a specific package from Testing you can do:

apt-get install pckg_name/testing

or

apt-get -t testing install pckg_name

Also you can build the package by yourself, first you need to need to install apt-listbugs , debhelper, devscripts, and build-essential

apt-get update
apt-get build-dep pckg_name
apt-get -b source pckg_name
dpkg -i pckg_name

Create a new file /etc/apt/preferences.d/testing and set the priority 900, apt will know the testing package have a higher priority.

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

then update

1
  • Thanks. Anyway, I know that, what I want is Debian not installing Unstable packages when doing a dist-upgrade. Apr 21, 2016 at 11:46
2

I went through a bit of documentation and I found a solution in the Debian administration handbook, section 2.7.6:
I have both Testing and Unstable repos in my /etc/apt/sources.list and I have created /etc/apt/preferences with

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

in it. Running apt-cache policy gnome-shell (I use gnome-shell as a tell-tale since different versions are available in Unstable and Testing, respectively 3.20 and 3.18) now correctly displays both 3.20 and 3.18 as available versions and the latter as the candidate.

The documentation I've found most useful:
https://www.debian.org/doc/manuals/debian-reference/ch02.en.html
man apt_preferences

2
  • I still have a couple of doubts, though: 1) The system should run the same way even if I set priority P for unstable so that 100 <= P < 500, right? 2) Say I install a package from Unstable, then I shut down my system and fire it up again 2 months later. By that time in Testing there would be a newer version than the one I got from Unstable. Apt should then track the version in Testing (because it's both higher priority and newer version), right? Apr 24, 2016 at 20:16
  • 1
    You're correct on both counts. Apr 26, 2016 at 15:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .