Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ubuntu] use /etc/os-release instead of lsb_release #6780

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chriscn
Copy link

@chriscn chriscn commented Feb 17, 2025

The /etc/os-release file is the standard. Any distribution based on systemd, including Red Hat Enterprise Linux, CentOS, Fedora, Gentoo, Debian, Mint, Ubuntu, and many others, is required to have that file. Distributions that don't use systemd may also have the file.

The /etc/os-release file is the standard. Any distribution based on systemd, including Red Hat Enterprise Linux, CentOS, Fedora, Gentoo, Debian, Mint, Ubuntu, and many others, is required to have that file. Distributions that don't use systemd may also have the file.
Copy link

welcome bot commented Feb 17, 2025

Thank you for opening this pull request 👍. If you are not familiar with the project, please check out our Contributing Guidelines and our Guiding Principles. Also take a look at our Hacking Guide if you intend to work on site internals.

@captn3m0
Copy link
Member

But this is the Ubuntu specific page, so others are irrelevant. I remember picking lsb_release because it gave a clearer answer to the question of "what release am I at".

But I noticed today, that it's not installed on Ubuntu minimal containers, so it's not perfect either.

I want to double check on this, give me a bit.

@usta
Copy link
Member

usta commented Feb 17, 2025

The /etc/os-release file is the standard. Any distribution based on systemd, including Red Hat Enterprise Linux, CentOS, Fedora, Gentoo, Debian, Mint, Ubuntu, and many others, is required to have that file. Distributions that don't use systemd may also have the file.

lsb_release is a common tool for almost all linux distro and ubuntu is also have it default. It doesnt just gives release version but also other info ( if you use with -a ) . And as far as i know it first checks /etc/lsb-release and if it doesnt exist it takes values from /etc/os-release . So this what this commit/PR brings for us ? [ the related tool already exist in *ubuntu distros except minimal containers ]

@usta usta changed the title Update ubuntu.md [ubuntu] use /etc/os-release instead of lsb_release Feb 17, 2025
@chriscn
Copy link
Author

chriscn commented Feb 17, 2025

https://lwn.net/Articles/658809/ - linux standard base has been deprecated from 2015 and removed. They've kept this command around but for posterity. The recommended way is to use /etc/os-release.

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.

3 participants