Finding out the OS distribution name
David Arnold
arnold at dstc.edu.au
Thu Oct 21 18:39:15 EDT 1999
-->"Marc-Andre" == M -A Lemburg <mal at lemburg.com> writes:
Marc-Andre> On SuSE Linux there's a file /etc/SuSE-release which
Marc-Andre> tells me the version etc.
on Debian GNU/Linux the file /etc/debian_version contains the
distribution version number (ie. 2.1 for my local system).
> cat /etc/debian_version
2.1
>
on RedHat Linux the file /etc/redhat-release contains the distribution
version number, and its code name, although the format seems to have
changed relatively recently ...
> cat /etc/redhat-release
release 5.0 (Hurricane)
>
> cat /etc/redhat-release
Red Hat Linux release 5.2 (Apollo)
>
> cat /etc/redhat-release
Red Hat Linux release 6.0 (Hedwig)
>
Marc-Andre> It's a pitty that "uname" doesn't return this
Marc-Andre> information.
it does get you kernel version which can be useful, especially as
people are reasonably likely to upgrade the kernel within a
distribution.
Marc-Andre> I was thinking of something similar to the config.guess
Marc-Andre> shell script included in autoconf. A bit more
Marc-Andre> simpleminded perhaps but with enough information to be
Marc-Andre> recognizable by a human :-) I would like to include it
Marc-Andre> in the mxCGIPython project (see my Python Pages) which
Marc-Andre> automatically generates a canonical name for the system
Marc-Andre> where the binary is being compiled on.
that'd be nice.
d
More information about the Python-list
mailing list