[Opensim-dev] Determining Linux Platform (Distribution)
Chris Down
chris.down at alcor.co.uk
Sat Jan 26 09:23:25 UTC 2008
> On Linux, the best way to determine distribution information is to parse
> the output of "lsb_release -a". However, parsing the contents of
> /etc/lsb-release is a good second best.
>
> jkaldon at bullshark:~$ lsb_release -a
> No LSB modules are available.
> Distributor ID: Ubuntu
> Description: Ubuntu 6.06.1 LTS
> Release: 6.06
> Codename: dapper
>
> jkaldon at bullshark:~$ cat /etc/lsb-release
> DISTRIB_ID=Ubuntu
> DISTRIB_RELEASE=6.06
> DISTRIB_CODENAME=dapper
> DISTRIB_DESCRIPTION="Ubuntu 6.06.1 LTS"
>
> Reasonably detailed and is present on any distribution who tries to
> conform to the Linux Standards Base. This includes RedHat, Debian, Ubuntu
> and many others I'm sure.
I can confirm that lsb_release -a produces the required information on
Opensuse.
chris at merak:~> lsb_release -a
LSB Version:
core-2.0-noarch:core-3.0-noarch:core-2.0-x86_64:core-3.0-x86_64:desktop-3.1-
amd64:desktop-3.1-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.1
-amd64:graphics-3.1-noarch
Distributor ID: SUSE LINUX
Description: openSUSE 10.3 (X86-64)
Release: 10.3
Codename: n/a
However the file /etc/lsb-release does not contain any distribution
information in Opensuse.
chris at merak:~> cat /etc/lsb-release
LSB_VERSION="core-2.0-noarch:core-3.0-noarch:core-2.0-x86_64:core-3.0-x86_64
"
Regards
Chris Down
More information about the Opensim-dev
mailing list