LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   os/distro information methods (https://www.linuxquestions.org/questions/linux-newbie-8/os-distro-information-methods-4175489165/)

saivinoba 12-25-2013 06:48 PM

os/distro information methods
 
Hi,
Can somebody explain (or point to all-in-one place explanation of) what are /etc/issue, /etc/lsb-release, /etc/$(distro)_version, /etc/os-release? LinuxMint even has /etc/linuxmint/info. Why there are so many ways to identify a distro, what are differences between them, where and how they are used?

From my Linux Mint Petra:
/etc/issue :
Code:

Linux Mint 16 Petra \n \l
/etc/lsb-release :
Code:

DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=16
DISTRIB_CODENAME=petra
DISTRIB_DESCRIPTION="Linux Mint 16 Petra"

/etc/os-release :
Code:

NAME="Ubuntu"
VERSION="13.10, Saucy Salamander"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 13.10"
VERSION_ID="13.10"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

/etc/linuxmint/info :
Code:

RELEASE=16
CODENAME=petra
EDITION="Cinnamon 32-bit"
DESCRIPTION="Linux Mint 16 Petra"
DESKTOP=Gnome
TOOLKIT=GTK
NEW_FEATURES_URL=http://www.linuxmint.com/rel_petra_cinnamon_whatsnew.php
RELEASE_NOTES_URL=http://www.linuxmint.com/rel_petra_cinnamon.php
USER_GUIDE_URL=http://www.linuxmint.com/documentation.php
GRUB_TITLE=Linux Mint 16 Cinnamon 32-bit

Linux Mint does not have a linuxmint_version instead has debian_version.
/etc/debian_version:
Code:

wheezy/sid
See, with os-release, it is identifying itself as Ubuntu while with debian_version as wheezy/sid.

While lsb may stand for Linux Standard Base, I did not see /etc/lsb-release in debian and slackware.

Thanks in advance.

druuna 12-26-2013 03:16 AM

The /etc/issue file in your above examples isn't part of identifying the OS. It is a pre-login message file, which can hold anything you like (out of the box it most often shows distro and version information).

The reason there are so many ways to fetch distro related info is historic in nature. Many distro's had their own way of making this info available. There are loose conventions /etc/os-release and /etc/distro_name-release are often seen.

The LSB way of doing things is being pushed forward, but to be able to be backward compatible the old way(s) are also still in use. Some applications check this when it is being installed (which makes life interesting some times...).

BTW: Debian does make use of LSB, although there is no /etc/lsb-release file. Run the following command: lsb_release -a

saivinoba 12-26-2013 06:10 AM

Hi druuna,
Thanks for the info. I read man page for 'issue'. You are correct. I switched between console and GUI, and edited issue file to confirm it.

Wrt other files, if I understood correctly,
a) these are just the way a distro would show its information, there is no right-way or accepted standard. Say, something like setting hostname? with /etc/hostname, /etc/HOSTNAME, /etc/sysconfig/network?

b) the information is used by programs/services.
I could think of one program, grub2 (GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`). And there was a discussion in Archlinux forums that Steam categorises their distro in general category as "Linux (64-bit)" and therefore they are missing valuable info as to how many Arch users are there with Steam _because_ they don't ship lsb-release by default and Steam uses that info in their survey.
Which way to show OS info is between distro and applications that use the info. If the distro is influential, it's method can become the de-facto standard, if not the distro has to change (or atleast provide addtional methods) how it identifies itself.

Correct me if I'm wrong. Thanks again,
Sai

druuna 12-26-2013 06:27 AM

Quote:

Originally Posted by saivinoba (Post 5087116)
Thanks for the info. I read man page for 'issue'. You are correct. I switched between console and GUI, and edited issue file to confirm it.

You're welcome.

Quote:

Wrt other files, if I understood correctly,
a) these are just the way a distro would show its information, there is no right-way or accepted standard. Say, something like setting hostname? with /etc/hostname, /etc/HOSTNAME, /etc/sysconfig/network?
Correct, although LSB is being pushed forward as a (future) standard. Not all distro's have implemented it yet. And, as always with "standards", some distro's might even decide to ignore it altogether.

Quote:

b) the information is used by programs/services.
I could think of one program, grub2 (GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`). And there was a discussion in Archlinux forums that Steam categorises their distro in general category as "Linux (64-bit)" and therefore they are missing valuable info as to how many Arch users are there with Steam _because_ they don't ship lsb-release by default and Steam uses that info in their survey.
Which way to show OS info is between distro and applications that use the info. If the distro is influential, it's method can become the de-facto standard, if not the distro has to change (or atleast provide addtional methods) how it identifies itself.
This issue has 2 sides: The (specific) distro needs to implement a standard (be it LSB or something different), but the application builders also need to implement a standard way of determining the distro used.

My money (long run) will be on LSB, but as long as there is no actual standard one might need to be creative to get a certain application to install....


All times are GMT -5. The time now is 02:51 AM.