How to identify a specific linux distro - Mandriva

This is a discussion on How to identify a specific linux distro - Mandriva ; Are there any general files or commands that most distros contain which will identify what distro one is currently using? I'm thinking of this is terms of programmatically being able to set up default installation file paths and such depending ...

+ Reply to Thread
Results 1 to 10 of 10

Thread: How to identify a specific linux distro

  1. How to identify a specific linux distro

    Are there any general files or commands that most distros contain which will
    identify what distro one is currently using?

    I'm thinking of this is terms of programmatically being able to set up
    default installation file paths and such depending on the distro being
    used.

    TIA

    Rob.



  2. Re: How to identify a specific linux distro

    Rob wrote:

    > Are there any general files or commands that most distros contain which
    > will identify what distro one is currently using?
    >
    > I'm thinking of this is terms of programmatically being able to set up
    > default installation file paths and such depending on the distro being
    > used.
    >


    Not long after sending this message it dawned on me that the 'uname -r'
    command string should be adequate for my needs. Thanks to anyone who had
    already responded to the original post.

    Rob.

  3. Re: How to identify a specific linux distro

    On Sun, 20 Apr 2008 22:16:08 +1000, Rob wrote:

    > Not long after sending this message it dawned on me that the 'uname -r'
    > command string should be adequate for my needs. Thanks to anyone who had
    > already responded to the original post.


    The 'uname -r' command does not identify the distro in use. It shows the
    currently running kernel version.

    Now, in some distros, you can decipher what distro it is, because they
    include something like "mdk" or "mdv" as part of the kernel name. That is
    certainly not a standardized thing across distros.

    Many (most?) distros include a file in the /etc directory which is named:
    /etc/-version which tells you what you want. For example, on my
    Slackware system, the file '/etc/slackware-version' shows:
    "Slackware 12.0.0". You could do something like the following command to
    see if there are any 'version' files in /etc : 'ls /etc/*-version".
    Another possibility would be to grep for the word 'version' in the /etc
    directory, like this: 'ls /etc | grep version'.

    HTH.


    --
    "Ubuntu" -- an African word, meaning "Slackware is too hard for me".
    The Usenet Improvement Project: http://improve-usenet.org


  4. Re: How to identify a specific linux distro

    Dan C writes:

    > On Sun, 20 Apr 2008 22:16:08 +1000, Rob wrote:
    >
    >> Not long after sending this message it dawned on me that the 'uname -r'
    >> command string should be adequate for my needs. Thanks to anyone who had
    >> already responded to the original post.

    >
    > The 'uname -r' command does not identify the distro in use. It shows the
    > currently running kernel version.
    >
    > Now, in some distros, you can decipher what distro it is, because they
    > include something like "mdk" or "mdv" as part of the kernel name. That is
    > certainly not a standardized thing across distros.
    >
    > Many (most?) distros include a file in the /etc directory which is named:
    > /etc/-version which tells you what you want. For example, on my
    > Slackware system, the file '/etc/slackware-version' shows:
    > "Slackware 12.0.0". You could do something like the following command to
    > see if there are any 'version' files in /etc : 'ls /etc/*-version".
    > Another possibility would be to grep for the word 'version' in the /etc
    > directory, like this: 'ls /etc | grep version'.


    I remember this being discussed a while back, but don't remember all
    the details. On a Fedora or Mandriva system the "right" file would
    be /etc/*-release.

    Some combination of /etc/*release and /etc/*version would probably do
    the job.

    The OP would probably be better off not looking for the distro,
    but instead looking for the feature that he's interested in.
    Something like what configure scripts do.

  5. Re: How to identify a specific linux distro

    Rob wrote:
    > Rob wrote:
    >> Are there any general files or commands that most distros contain which
    >> will identify what distro one is currently using?
    >>
    >> I'm thinking of this is terms of programmatically being able to set up
    >> default installation file paths and such depending on the distro being
    >> used.
    >>

    >
    > Not long after sending this message it dawned on me that the 'uname -r'
    > command string should be adequate for my needs. Thanks to anyone who had
    > already responded to the original post.


    You may also want to look at the contents of /etc/version.

    Cheers!

    jim b.

    --
    UNIX is not user-unfriendly; it merely
    expects users to be computer-friendly.

  6. Re: How to identify a specific linux distro

    On Sun, 20 Apr 2008 22:03:37 +1000, Rob wrote:
    > Are there any general files or commands that most distros contain which will
    > identify what distro one is currently using?


    You might try lsb_release -a

  7. Re: How to identify a specific linux distro

    On Sun, 20 Apr 2008 15:43:01 +0000, Bit Twister wrote:

    >> Are there any general files or commands that most distros contain which will
    >> identify what distro one is currently using?


    > You might try lsb_release -a


    Apparently that is not a standardized thing either...

    danc@moria:~$ lsb_release -a
    -bash: lsb_release: command not found


    --
    "Ubuntu" -- an African word, meaning "Slackware is too hard for me".
    The Usenet Improvement Project: http://improve-usenet.org


  8. Re: How to identify a specific linux distro

    Dan C writes:

    > On Sun, 20 Apr 2008 15:43:01 +0000, Bit Twister wrote:
    >
    >>> Are there any general files or commands that most distros contain which will
    >>> identify what distro one is currently using?

    >
    >> You might try lsb_release -a

    >
    > Apparently that is not a standardized thing either...
    >
    > danc@moria:~$ lsb_release -a
    > -bash: lsb_release: command not found


    Well, anything named "lsb" has to be standard.



    But you're right, it seems to be new.
    It's on my FC8 system and my RH4 system,
    but not my Mandriva 10.1 system.


  9. Re: How to identify a specific linux distro

    On Sun, 20 Apr 2008, in the Usenet newsgroup alt.os.linux.mandriva, in article
    , Rob wrote:

    >Rob wrote:
    >
    >> Are there any general files or commands that most distros contain which
    >> will identify what distro one is currently using?


    [compton ~]$ ls /etc/*release /etc/*version
    ls: /etc/*version: No such file or directory
    /etc/redhat-release
    [compton ~]$ cat /etc/*release
    Red Hat Linux release 3.0.3 (picasso)
    [compton ~]$

    Of course, some people may dink with that file ;-) Briefly, there are
    two families of distribution supplied files - this /etc/redhat-release
    was one of the originals, while Debian, Slackware and clones use the
    other format (/etc/debian_version, /etc/slackware-version, and so on).

    >> I'm thinking of this is terms of programmatically being able to set
    >> up default installation file paths and such depending on the distro
    >> being used.


    http://www.pathname.com/fhs/ which is a part of the "Linux Standard
    Base" (http://www.linuxbase.org/spec/). Distributions _should_ try
    to follow the standards. If they do, there is also

    [compton ~]$ whatis lsb_release
    lsb_release (1) - print distribution specific information
    [compton ~]$

    and maybe a /etc/lsb-release and even /etc/lsb-release.d/*

    >Not long after sending this message it dawned on me that the 'uname -r'
    >command string should be adequate for my needs.


    No, that is only required to be the _version_ of the kernel, and even
    if you try 'uname -a' you'll not see anything useful if the kernel is
    locally compiled.

    Old guy

  10. Re: How to identify a specific linux distro

    Dan Espen wrote:

    > Dan C writes:
    >
    >> On Sun, 20 Apr 2008 15:43:01 +0000, Bit Twister wrote:
    >>
    >>>> Are there any general files or commands that most distros contain which
    >>>> will identify what distro one is currently using?

    >>
    >>> You might try lsb_release -a

    >>
    >> Apparently that is not a standardized thing either...
    >>
    >> danc@moria:~$ lsb_release -a
    >> -bash: lsb_release: command not found

    >
    > Well, anything named "lsb" has to be standard.
    >
    >
    >
    > But you're right, it seems to be new.
    > It's on my FC8 system and my RH4 system,
    > but not my Mandriva 10.1 system.


    On my mdv 2008.1 system:

    # cat /etc/version
    2008.1.0 0.11 cambria

    # cat /etc/release
    Mandriva Linux release 2008.1 (Official) for i586

    # cat /etc/lsb-release
    LSB_VERSION=lsb-3.1-ia32:lsb-3.1-noarch
    DISTRIB_ID=MandrivaLinux
    DISTRIB_RELEASE=2008.1
    DISTRIB_CODENAME=cambria
    DISTRIB_DESCRIPTION="Mandriva Linux 2008.1"

    Jim


+ Reply to Thread