4

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:
  • Just run apt upgrade -t stable... Does that work for you? – Questionmark Mar 18 '16 at 19:37
  • Can you run apt-cache policy without any arguments, and add the output to the question? – Wouter Verhelst Mar 19 '16 at 10:42
  • @Questionmark This just says, everything is up to date and does nothing. – Michael Mar 21 '16 at 14:01
  • @WouterVerhelst here is the snippet: pastebin.com/CDRNXhU4 I wonder why there are no pinned packages marked, though ... – Michael Mar 21 '16 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... – Wouter Verhelst Mar 21 '16 at 14:07
4

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.

  • 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 '16 at 13:56
  • Ahh, using pkgname/stable instead of -t stable pkgname actually worked! Thanks! – Michael Mar 21 '16 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. – Faheem Mitha Mar 21 '16 at 14:41
1

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

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

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.

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.