Michael, Santiago, et al,

On Sat, 16 Aug 2025, Santiago Vila <[email protected]> wrote:

> File data/50unattended-upgrades.Debian in the source
> (and other similar files as well) has a comment
> saying this:
>
> // Within lines unattended-upgrades allows 2 macros whose values are
> // derived from /etc/debian_version:
> //   ${distro_id}            Installed origin.
> //   ${distro_codename}      Installed codename (eg, "buster")
>
> Maybe it should say this instead:
>
> // derived from /etc/debian_version and /etc/os-release:
>
> In fact, I'm not really sure if /etc/debian_version is still
> used these days, so maybe the right fix is to put os-release only,
> I don't really know.
> ...

/usr/bin/unattended-upgrade runs lsb_release:
 def init_distro_info():
     global DISTRO_CODENAME, DISTRO_DESC, DISTRO_ID
     DISTRO_CODENAME = subprocess.check_output(
         ["lsb_release", "-c", "-s"], universal_newlines=True).strip()
     DISTRO_DESC = subprocess.check_output(
         ["lsb_release", "-d", "-s"], universal_newlines=True).strip()
     DISTRO_ID = subprocess.check_output(
         ["lsb_release", "-i", "-s"], universal_newlines=True).strip()

lsb_release loads info from /etc/os-release or /usr/lib/os-release:
  # Load release info from standard identification data files
  [ -f /usr/lib/os-release ] && os_release=/usr/lib/os-release
  [ -f /etc/os-release ] && os_release=/etc/os-release
  [ "${LSB_OS_RELEASE-x}" != "x" ] && [ -f "$LSB_OS_RELEASE" ] &&
os_release="$LSB_OS_RELEASE"
  [ "${os_release-x}" != "x" ] && . "$os_release"

This bug is fixed in:
    #1115376 - 50unattended-upgrades.Debian is outdated
        https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1115376

Thank you!
Daniel Lewart
Urbana, Illinois

Reply via email to