5

I need to downgrade some apt packages, that I had previously pinned to testing, having stable as default. This is the preferences file:

Package: *
Pin: release a=stable
Pin-Priority: 1001

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

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

When I check the policy for one of the upgraded packages, I get:

apt-cache policy libstdc++5
libstdc++5:
  Installed: 1:3.3.6-28
  Candidate: 1:3.3.6-28
  Version table:
 *** 1:3.3.6-28 0
        500 http://mirror.hetzner.de/debian/packages/ testing/main amd64 Packages
        400 http://mirror.hetzner.de/debian/packages/ unstable/main amd64 Packages
        100 /var/lib/dpkg/status
     1:3.3.6-27.2 0
        990 http://mirror.hetzner.de/debian/packages/ stable/main amd64 Packages
        990 http://cdn.debian.net/debian/ stable/main amd64 Packages

Whenever I change the settings for testing and unstable, I see the changes in the priority reflected here. Though, the priority for the stable package won't change, whatever I tried so far. The idea is to set it >1000, to actually execute the downgrade. Any hints, how to actually change it?

This is the full output for apt-cache policy:

Package files:
 100 /var/lib/dpkg/status
     release a=now
 500 http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.7/main amd64 Packages
     release n=llvm-toolchain-jessie-3.7,c=main
     origin llvm.org
 990 http://security.debian.org/ stable/updates/non-free amd64 Packages
     release v=8,o=Debian,a=stable,n=jessie,l=Debian-Security,c=non-free
     origin security.debian.org
 990 http://security.debian.org/ stable/updates/contrib amd64 Packages
     release v=8,o=Debian,a=stable,n=jessie,l=Debian-Security,c=contrib
     origin security.debian.org
 990 http://security.debian.org/ stable/updates/main amd64 Packages
     release v=8,o=Debian,a=stable,n=jessie,l=Debian-Security,c=main
     origin security.debian.org
 990 http://cdn.debian.net/debian/ stable/contrib amd64 Packages
     release v=8.3,o=Debian,a=stable,n=jessie,l=Debian,c=contrib
     origin cdn.debian.net
 990 http://cdn.debian.net/debian/ stable/non-free amd64 Packages
     release v=8.3,o=Debian,a=stable,n=jessie,l=Debian,c=non-free
     origin cdn.debian.net
 990 http://cdn.debian.net/debian/ stable/main amd64 Packages
     release v=8.3,o=Debian,a=stable,n=jessie,l=Debian,c=main
     origin cdn.debian.net
 990 http://mirror.hetzner.de/debian/security/ stable/updates/non-free amd64 Packages
     release v=8,o=Debian,a=stable,n=jessie,l=Debian-Security,c=non-free
     origin mirror.hetzner.de
 990 http://mirror.hetzner.de/debian/security/ stable/updates/contrib amd64 Packages
     release v=8,o=Debian,a=stable,n=jessie,l=Debian-Security,c=contrib
     origin mirror.hetzner.de
 990 http://mirror.hetzner.de/debian/security/ stable/updates/main amd64 Packages
     release v=8,o=Debian,a=stable,n=jessie,l=Debian-Security,c=main
     origin mirror.hetzner.de
 400 http://mirror.hetzner.de/debian/packages/ unstable/non-free amd64 Packages
     release o=Debian,a=unstable,n=sid,l=Debian,c=non-free
     origin mirror.hetzner.de
 400 http://mirror.hetzner.de/debian/packages/ unstable/contrib amd64 Packages
     release o=Debian,a=unstable,n=sid,l=Debian,c=contrib
     origin mirror.hetzner.de
 400 http://mirror.hetzner.de/debian/packages/ unstable/main amd64 Packages
     release o=Debian,a=unstable,n=sid,l=Debian,c=main
     origin mirror.hetzner.de
 500 http://mirror.hetzner.de/debian/packages/ testing/non-free amd64 Packages
     release o=Debian,a=testing,n=stretch,l=Debian,c=non-free
     origin mirror.hetzner.de
 500 http://mirror.hetzner.de/debian/packages/ testing/contrib amd64 Packages
     release o=Debian,a=testing,n=stretch,l=Debian,c=contrib
     origin mirror.hetzner.de
 500 http://mirror.hetzner.de/debian/packages/ testing/main amd64 Packages
     release o=Debian,a=testing,n=stretch,l=Debian,c=main
     origin mirror.hetzner.de
 990 http://mirror.hetzner.de/debian/packages/ stable/non-free amd64 Packages
     release v=8.3,o=Debian,a=stable,n=jessie,l=Debian,c=non-free
     origin mirror.hetzner.de
 990 http://mirror.hetzner.de/debian/packages/ stable/contrib amd64 Packages
     release v=8.3,o=Debian,a=stable,n=jessie,l=Debian,c=contrib
     origin mirror.hetzner.de
 990 http://mirror.hetzner.de/debian/packages/ stable/main amd64 Packages
     release v=8.3,o=Debian,a=stable,n=jessie,l=Debian,c=main
     origin mirror.hetzner.de
Pinned packages:
6
  • Just run apt upgrade -t stable... Does that work for you? Mar 18, 2016 at 19:37
  • Can you run apt-cache policy without any arguments, and add the output to the question? Mar 19, 2016 at 10:42
  • @Questionmark This just says, everything is up to date and does nothing.
    – Michael
    Mar 21, 2016 at 14:01
  • @WouterVerhelst here is the snippet: pastebin.com/CDRNXhU4 I wonder why there are no pinned packages marked, though ...
    – Michael
    Mar 21, 2016 at 14:02
  • Please don't use a paste bin, just edit the question and add the information. Otherwise a person later looking at this doesn't get all the information... Mar 21, 2016 at 14:07

3 Answers 3

5

I don't understand why you are doing here. Why do you have a preferences setting for stable at all if you are running a stable system? As far I know, no preferences setting is necessary for stable in that case.

You don't explicitly say whether you are running a stable system (you really should say so), but if you are not, then I really have no idea what you are doing.

And if the release is on stable, then the usual thing to do for testing and unstable is to set their preferences to less than 100. I usually use 50.

And if you want to downgrade to stable, just do the following (assuming sane settings like the ones above) to downgrade pkgname1 and pkgname2:

apt-get install pkgname1/stable pkgname2/stable

This sets the specified packages to the target release stable.

Incidentally, mixing testing and/or unstable packages with an unstable system is generally a bad idea unless you know what you are doing. Some of the time it is Ok, but most of the time you need to use backports, either from Debian, or self-made.

3
  • I use the stable system, as far as the packages there were recent enough. Unfortunately some libraries turned out to be too old, so I had to pin some C build stuff to more recent versions from testing. In the long run this got quite messy, and I'd like to revert it to a clean stable setup.
    – Michael
    Mar 21, 2016 at 13:56
  • Ahh, using pkgname/stable instead of -t stable pkgname actually worked! Thanks!
    – Michael
    Mar 21, 2016 at 14:18
  • As I already said, in general you don't want to just pull in binary packages from testing. This will just create problems. You need to do backports. In particular, you want to avoid upgrading any portion of the GNU toolchain to versions later than the one in stable, and especially libc6. Of course, this is with the proviso that if you don't follow these practices, you need to know what you are doing. Mar 21, 2016 at 14:41
2

Move the stable block to the end of your preferences file, otherwise the later (wildcard) entries override it.

2
  • But if everything would be overridden, I should get all unstable packages, which I don't ?!
    – Michael
    Mar 21, 2016 at 14:04
  • This is not true, the three stanzas here each specify different packages through their Pin: line. Mar 21, 2016 at 14:06
2

It looks like the pinning is actually working, except for the stable part. This is probably because you are also using an APT::Default-Release "stable"; line in apt.conf. this overrides your pinning preferences. Just remove that line, and you should be all set.

You must log in to answer this question.

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