Determining linux distribution

Christopher Browne cbbrowne-Re5JQEeQqe8AvxtiuMwx3w at public.gmane.org
Sun Apr 17 20:54:06 UTC 2005


On 4/17/05, John Vetterli <jvetterli-zC6tqtfhjqE at public.gmane.org> wrote:
> On Sat, 16 Apr 2005, dan sinclair wrote:
> > You could try something like
> > cat /etc/*-release
> > Redhat, SuSe and Gentoo at least seem to stick a release file
> > in /etc....
> 
> You might also want to try /etc/*-version.  Slackware has an
> /etc/slackware-version file; this might work for some other distro too.
> 
> I know Debian has a /etc/debian-<something> file.

Either /etc/*release* or /etc/*version* is likely to find the answer
to this question.

Unfortunately, I'm not certain that it is a useful question to be
asking in the first place.  There is considerable variation between
different versions of any given distribution, and knowing that some
system *started* as Red Hat or Debian or such doesn't imply that
everything is as it was installed.

We've got a Debian box at the office, for instance, that is running a
really ancient version and where it's using a custom-compiled version
of Exim, and is of sufficiently unstable provenance that I wouldn't
want to pretend to run anything heavily automated against it...

Perhaps the O.P. should indicate what the _real_ purpose behind the
question is.

I would expect that the _right_ answer to some attempt at portability
is to do things rather like "configure" and look around to see where
the needful components might be.  Don't assume that since it's Debian,
you'll find Exim config in the canonical spot, particularly since I
might have replaced that with Postfix...
-- 
http://www3.sympatico.ca/cbbrowne/linux.html
"The true  measure of a  man is how he treats  someone who can  do him
absolutely no good." -- Samuel Johnson, lexicographer (1709-1784)
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list