LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-25-2013, 06:48 PM   #1
saivinoba
Member
 
Registered: Oct 2007
Distribution: FreeBSD, Slackware
Posts: 48

Rep: Reputation: 9
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.

Last edited by saivinoba; 12-25-2013 at 06:52 PM.
 
Old 12-26-2013, 03:16 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
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
 
1 members found this post helpful.
Old 12-26-2013, 06:10 AM   #3
saivinoba
Member
 
Registered: Oct 2007
Distribution: FreeBSD, Slackware
Posts: 48

Original Poster
Rep: Reputation: 9
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
 
Old 12-26-2013, 06:27 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Quote:
Originally Posted by saivinoba View Post
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....
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Linux Information and Distro Ztcoracat Linux - General 3 01-19-2012 09:58 PM
Distro Information from Bash shifty_eyes Linux - Newbie 7 10-13-2005 08:18 PM
Background information on install methods Maarten_Holland Linux - Newbie 3 02-26-2005 04:34 AM
Need Distro Information AEGIS Hero Linux - Newbie 3 02-18-2005 11:42 AM
Information on patches for older RedHat distro versions jason.hewitt Red Hat 3 12-13-2004 04:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration