Debian – How to programmatically get the Debian codename of ‘testing’

debian

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).

Best Answer

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"
Related Question