Bug#696332: lsb-release: release/codename depend on a successful apt-get

Thorsten Glaser t.glaser at tarent.de
Tue May 18 18:44:02 BST 2021


On Tue, 18 May 2021, Benjamin Drung wrote:

> In case /usr/lib/os-release sets VERSION_CODENAME or
> /etc/debian_version specifies only one codename, lsb-release takes the
> information from there. base-files 11 don't set these values (and
> therefore trigger this bug), but base-files 11.1 does set these values
> (and therefore does not trigger this bug). Once bullseye is released,
> base-files will be updated and trigger the bug again.

It gets worse: unstable will, for a while, register as next-stable
instead, throwing off buildds and all that. Furthermore, this breaks
horribly when you have more than one release in your sources.list
and on debian-ports platforms.

> I ran into this issue with salt. salt failed to determine its codename
> grain after a fresh boot.

Older lsb-release versions had as the official fix to write into
/etc/lsb-release the following lines…

DISTRIB_RELEASE=unstable
DISTRIB_CODENAME=sid

… and things would work. For some <censored/> reason, probably
something to do with systemd/fdo/whatever shiny new thing, this
was desupported after stretch; from buster onwards, you have to
instead create /usr/lib/os-release.sid which needs to contain
all fields, not just the overrides…

PRETTY_NAME="Debian GNU/Linux sid"
NAME="Debian GNU/Linux"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
VERSION_ID=unstable
VERSION_CODENAME=sid

… and then run…

sudo dpkg-divert --rename --divert /usr/lib/os-release.dpkg-dist \
    --add /usr/lib/os-release
sudo ln -sfT os-release.sid /usr/lib/os-release

… to fix this issue. (To remove, dpkg-divert can be used, but you
can’t switch from sid to testing or stable anyway. Even then the
/etc/lsb-release method was easier to do.)

Even before buster it was said that, to run a sid system (or even
a testing system, I suppose, but I don’t), this is mandatory, but
neither has this found its way into any kind of official documentation
nor does the desupporting of /etc/lsb-release help with it :/

tl;dr: Run the above dpkg-divert+ln after /usr/lib/os-release.sid
creation immediately after or even during creation of a sid chroot
or system/VM image.

Hmm. Someone should add that to modules/schroot/files/setup-dchroot
in dsa-puppet, I think, for sid chroots anyway. Jessica?

bye,
//mirabilos
-- 
«MyISAM tables -will- get corrupted eventually. This is a fact of life. »
“mysql is about as much database as ms access” – “MSSQL at least descends
from a database” “it's a rebranded SyBase” “MySQL however was born from a
flatfile and went downhill from there” – “at least jetDB doesn’t claim to
be a database”	(#nosec)    ‣‣‣ Please let MySQL and MariaDB finally die!



More information about the Debian-init-diversity mailing list