[lug] What distro am I running?

George Sexton gsexton at mhsoftware.com
Mon Mar 10 11:31:10 MDT 2008


I think you would have more success looking at /etc/issue

Jeffrey Haemer wrote:
> My Ubuntu boxes have a file called /etc/lsb-release that looks like this:
> 
>     DISTRIB_ID=Ubuntu
>     DISTRIB_RELEASE=7.10
>     DISTRIB_CODENAME=gutsy
>     DISTRIB_DESCRIPTION="Ubuntu 7.10"
> 
> 
> Nice.
> 
> My Fedora 8 boxes have no such file, but have a directory, 
> /etc/lsb-release.d, with a bunch of 0-length files.
> The SuSE 10.1 boxes have both.  Their /etc/lsb-release.d is full of 
> empty files, and their /etc/lsb-release looks like this:
> 
>     LSB_VERSION="core-2.0-noarch:core-3.0-noarch:core-2.0-ia32:core-3.0-ia32"
> 
> 
> All three have a command called lsb_release(1).  Here's what the command 
> spits out:
> 
> F8
>     LSB Version:    
> :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
> SuSE
>     LSB Version:    
> core-2.0-noarch:core-3.0-noarch:core-2.0-ia32:core-3.0-ia32:graphics-2.0-ia32:graphics-2.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch
> Ubuntu
>     No LSB modules are available.
> 
> Fedora 8 sticks release info into /etc/redhat-release.  Other RH distros 
> have this, too, even if I have to do a minor amount of parsing on the 
> contents.
> 
> Fedora Core release 6 (Zod)
> Fedora release 8 (Werewolf)
> Red Hat Enterprise Server release 5.1 (Tikanga)
> 
> SuSE sticks version stuff into a multi-line /etc/SuSE-release, analogous 
> to Ubuntu's /etc/lsb-release, but with a different syntax.
> 
>     SUSE LINUX 10.1 (i586)
>     VERSION = 10.1
> 
> So, is there an /etc/ubuntu-release?  Of course not.  But there is an 
> /etc/debian_version, which says
> 
>     lenny/sid
> 
> 
> I can hand-craft and maintain a special-purpose script to puzzle it out, 
> but I thought I'd ask whether there's a simple, standard command, 
> analogous to uname, to tell me what the heck distro I'm running.  I'd 
> like to be able to invoke it within scripts that do other, 
> distro-specific stuff.
> 
> -- 
> Jeffrey Haemer <jeffrey.haemer at gmail.com <mailto:jeffrey.haemer at gmail.com>>
> 720-837-8908 [cell]
> http://goyishekop.blogspot.com
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Web Page:  http://lug.boulder.co.us
> Mailing List: http://lists.lug.boulder.co.us/mailman/listinfo/lug
> Join us on IRC: lug.boulder.co.us port=6667 channel=#colug

-- 
George Sexton
MH Software, Inc.
Voice: +1 303 438 9585
URL:   http://www.mhsoftware.com/



More information about the LUG mailing list