8

As per the title, I'd like to resolve the Debian codename (e.g. "stretch", "buster", "bullseye", etc) of the current "testing".

Obviously there are a variety of ways to do this within an installed Debian "testing" system (e.g. lsb_release -sc, among others as noted in answers to this question). But how do I do this from a Debian 'stable' (or even an alternate Linux distro)?

For example, I'm running Debian 'stable' (currently Debian 'buster') - how do I reliably determine what codename 'testing' currently has?

I realise that currently 'testing' = 'bullseye', but when 'bullseye' is released as 'stable', that will change (to 'bookworm' IIRC).

2 Answers2

11

Alternate method: install the package distro-info (pulling distro-info-data), from backports if available there, and run:

distro-info --testing

For example currenly, on Debian 9 oldstable, with distro-info 0.21~bpo9+1 from stretch-backports:

$ distro-info --testing
bullseye
$ distro-info --fullname --testing
Debian 11 "Bullseye"

Had the package version for distro-info-data be kept to stretch/oldstable 0.14, the result would have been obsolete: buster, but that's because it's oldstable. Expect it to be up to date on stable for the next testing codename, and up to date in the previous release's backports.

$ distro-info --fullname --all|tail
Debian 5.0 "Lenny"
Debian 6.0 "Squeeze"
Debian 7 "Wheezy"
Debian 8 "Jessie"
Debian 9 "Stretch"
Debian 10 "Buster"
Debian 11 "Bullseye"
Debian 12 "Bookworm"
Debian  "Sid"
Debian  "Experimental"
A.B
  • 36,364
  • 2
  • 73
  • 118
  • Nice one! I wasn't aware of that package. I note that the distro-info-data package contains the info within a csv file, so if the program could read csv data, that could even be read directly from there. – Jeremy Davis Mar 09 '20 at 22:32
  • Yes but why bother when there's an easy command going along with it. – A.B Mar 09 '20 at 22:40
  • Because then there's no need to call an external application. I wasn't necessarily recommending it as the "best path", I was just noting it as a possibility. – Jeremy Davis Mar 10 '20 at 01:15
9

To answer my own question, it turns out it's actually pretty easy...:

curl -sL https://deb.debian.org/debian/dists/testing/InRelease | grep "^Codename:" | cut -d' ' -f2

Currently that returns:

bullseye
  • 1
    Use -sL to make curl quiet and follow redirects if any – muru Mar 06 '20 at 06:54
  • This seems to require an internet connection, is that not a problem? – bobsburner Mar 06 '20 at 10:10
  • @bobsburner - You are correct, it does require an internet connection. It wasn't an issue for me, but it certainly could be if you didn't have internet. The other answer here doesn't require an internet connection at the time, but does still require package installation (and the info will become outdated). I can't imagine how you might be able to determine this reliably without internet (at some point), but if you know, please share. – Jeremy Davis Mar 09 '20 at 22:31
  • Why the recent downvotes (4 in total in the last month!)? If there is something wrong with this answer please post a comment rather than just downvoting... FWIW, this still works for me... – Jeremy Davis May 16 '21 at 23:32