1

I believe there is no official way to do this but I am hoping for a best practices suggestion.

Background: When Debian 9 is rolled out and testing is unfrozen (and therefore becomes v10), I assume lots of packages from unstable will move to testing. At that point I will want to start using testing again, assuming the packages I need are included.

So the question I have is how can I do this elegantly?

  • "At that point I will want to start using testing again". What would you be using previous to that point - unstable? – Faheem Mitha Jun 9 '17 at 3:50
  • Yes, unstable. I am currently using unstable and want to begin to use testing, once the packages that I need are in testing. – stone.212 Jun 9 '17 at 4:05
  • This might be useful, unix.stackexchange.com/a/153606/152478 – J.J. Hakala Jun 9 '17 at 21:54
5

If you want to track the testing distribution, I would strongly recommend running a mixture of testing and unstable: that will allow you to pull in updated packages from unstable if necessary (e.g. for security fixes). To do this, ensure both testing (named as such, rather than the specific release name) and unstable are available in your configured repositories; then set up pinning, e.g. in /etc/apt/preferences:

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

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

This will result in packages being tracked in testing if they’re available there, unstable if they’re not, or if they’re installed in a version newer than what’s available in testing. As Debian transitions from preparing Stretch to preparing Buster, and packages migrate from unstable to testing, your local installation will progressively start tracking Buster instead of unstable. This avoids needing to downgrade anything, and hopefully should result in a Buster setup in relatively short order after Stretch is released since testing and unstable haven’t yet diverged too much. (This will change very quickly after Stretch releases, so make sure you set this up before then.)

This kind of setup avoids issues with packages disappearing from testing for sometimes long periods. It also makes it easy to track security uploads to unstable, using Paul Wise’s patch to debsecan. I’ve been running this on my main setup for years without issue (but then again, I’m intimately familiar with the inner workings of Debian). The annoyances Fahim mentions in his answer mostly concern new installations of packages, which can be troublesome in pure testing; in practice they’re not much of an issue on a running system.

The usual caveats to running testing and/or unstable apply. You should make sure you’re familiar with the best practices. In particular, make sure you’re aware of all the changes apt-get wants to make on upgrades before letting it loose.

  • This sounds like the way to go, but I am concerned that there will be too many packages to pin them all. Is the asterisk a wildcard, or is it a placeholder? Meaning: do I have to specify all packages or will the wildcard handle everything? – stone.212 Jun 12 '17 at 0:01
  • I did some research and I wonder what you think about the note from JoshuaRodman on this page: wiki.debian.org/AptPreferences – stone.212 Jun 12 '17 at 2:20
  • The asterisk is a wildcard, you don’t need to specify individual packages (but you can if you want, e.g. to pull in a specific package from unstable). Joshua’s note is very old (dating back to Woody), but it’s a useful idea in some circumstances (I do something similar for non-free); I wouldn’t use that approach in general myself, but feel free to use it if it makes you feel safer. (The comment about testing depending on unstable is odd though; testing is supposed to be consistent.) – Stephen Kitt Jun 12 '17 at 5:11
  • Great. Your thoughts on Joshua's comments align with my own. So this q/a and the debian link (wiki.debian.org/AptPreferences) should combine to be a good answer to this question as of June 2017, right before Debian 9 comes out. Also, I have done this on one of my servers and then upgraded and didn't have any problems, so I guess it's working so far. Thank you @Stephen Kitt – stone.212 Jun 12 '17 at 21:55
  • 1
    If you specify buster instead of testing you’ll end up on Buster, which is current testing, and when that releases as Debian 10, you’ll stay on it even though it will then be stable. At that point (after the release of Debian 10) you should remove the unstable entries. – Stephen Kitt Aug 17 '17 at 8:39
1

When you're ready to switch to testing, I'd just switch your sources from unstable to testing, or adjust your preferences. You would also need to downgrade the packages that have an unstable version that is higher than the testing version from the unstable version to the testing version. This downgrading may or may not be easy to do, but I don't think that is anything else you can do. A separate question, which you have not asked, is whether this is a good idea. I don't believe it is. because for much of the time till late in the testing cycle (or so I have heard) unstable is actually more reliable than testing.

If you want to ask about whether your procedure is a good idea, you could add that question to your current question, or write a separate question. I think the former would be reasonable.

To downgrade an individual package, the following works to a first approximation

apt-get install pkgname/release

In the case mentioned here, release=testing. You might need to also force a downgrade for additional packages, depending on the dependencies. You can specify them on the command line as additional arguments, namely

apt-get install pkgname1/release pkgname2/release ...
  • You said "You would also need to downgrade the packages that have an unstable version that is higher than the testing version from the unstable version to the testing version. " How would you approach that? Can you edit your answer to say? – stone.212 Jun 9 '17 at 7:48
  • See edit. But this topic is covered in additional questions on this site. – Faheem Mitha Jun 9 '17 at 17:30
  • Can you send those links? I posted this after searching, and if I didn't find them then someone else might not also. It's often the case that people who already know the answer can recognize a question as being appropriate, but people who don't know don't realize that there is a connection. – stone.212 Jun 12 '17 at 21:57
  • Hi @stone.212 I added the relevant information to the question as you requested. Doing a search for "debian downgrade packages" gives various hits. Unfortunately, much of this is not useful. The method I've recommended is safe. In particular, I do NOT recommend messing with the priorities in /etc/apt/preferences, as some people have suggested. – Faheem Mitha Jun 13 '17 at 4:41
  • 1
    @Faheem we don’t officially support downgrading ;-). Why don’t you recommend changing priorities? – Stephen Kitt Jun 13 '17 at 12:10

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.