Skip to content

install: Detect Ubuntu codename without /etc/lsb-release - #583

Merged
thaJeztah merged 1 commit into
docker:masterfrom
vvoland:update-distro
Oct 13, 2026
Merged

thaJeztah merged 1 commit into
docker:masterfrom
vvoland:update-distro

Conversation

@vvoland

@vvoland vvoland commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Ubuntu 26.10 (stonking) images no longer ship /etc/lsb-release, and
the base image has no lsb_release command.
Both codename lookups returned nothing, so the apt source line had no
suite and apt-get update failed:

deb [...] https://download-stage.docker.com/linux/ubuntu  test
E: Malformed entry 1 in list file /etc/apt/sources.list.d/docker.list (Component)

Read VERSION_CODENAME from /etc/os-release first, which every supported
Ubuntu release provides and get_distribution already relies on.
lsb_release and /etc/lsb-release remain as fallbacks when os-release has
no codename.

@vvoland vvoland self-assigned this Oct 13, 2026
Ubuntu 26.10 (stonking) images no longer ship /etc/lsb-release, and
the base image has no lsb_release command.
Both codename lookups returned nothing, so the apt source line had no
suite and apt-get update failed:

```
deb [...] https://download-stage.docker.com/linux/ubuntu  test
E: Malformed entry 1 in list file /etc/apt/sources.list.d/docker.list (Component)
```

Read VERSION_CODENAME from /etc/os-release first, which every supported
Ubuntu release provides and get_distribution already relies on.
lsb_release and /etc/lsb-release remain as fallbacks when os-release has
no codename.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@thaJeztah

Copy link
Copy Markdown
Member

Was curious of course if it's (e.g.) now an optional install or deprecated, but seems related to https://ubuntuhandbook.org/index.php/2026/07/ubuntu-remove-etc-debian-version/

As the Ubuntu developer announced, scripts and programs should look at /etc/os-release file, which has been the de-facto standard in the last 10 years, instead of /etc/debian_version. And, due to the favor of /etc/os-release, most recent build of base-files has removed /etc/lsb-release.

  • /etc/lsb-release: Ubuntu 26.10 has removed this legacy file from base-files, in favor of /etc/os-release. This is an intentional migration; https://ubuntuhandbook.org/index.php/2026/07/ubuntu-remove-etc-debian-version/
  • lsb_release command: Still available through the optional lsb-release package in Ubuntu 26.10. It now uses a minimal POSIX shell implementation that reads /etc/os-release, rather than requiring Python or the original LSB implementation.

@thaJeztah thaJeztah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah
thaJeztah merged commit ada7a56 into docker:master Oct 13, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants