Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

The Python M2Crypto library requires a slightly different installation command if the Linux distribution is Fedora-core based (e.g., Fedora, RHEL, CentOS, Scientific Linux).

Is there a way to check if a distribution is Fedora-Core based, so I can write a script to execute the correct install command depending on the distribution?

share|improve this question
add comment

3 Answers

up vote 2 down vote accepted

Don't check if your platform is Fedora-based. Check if it needs this specific workaround. Execute this command: ls /usr/include/openssl/*-* and see if you have an opensslconf-x86_64.h file or an opensslconf-i386.h file.

share|improve this answer
add comment

This would depend on how much the distribution was modified, but normally there should be a file named /etc/fedora-release containing obviously the name of the release (surprise!) On my Fedora laptop it contains the line

 Fedora release 14 (Laughlin)

On the CentOS Server it is redhat-release:

 [0] ktf> cat /etc/redhat-release
 CentOS release 5.6 (Final)

I believe (but I'm not sure at this moment ) that SciLi also features a file redhat-release

share|improve this answer
add comment

Search all rpms for a rpm-name of "release". All distributions that I checked have a name like that (RedHat, CentOS 3/4/5, SLES 9/10/11). From that you can deduce which distro it is (at least the major release is often represented as version of that rpm, too).

Many "professional" scripts (e.g. Dell-OMSA) do search for /etc/redhat-relase, /etc/SuSE-release and then parse these to get the major/minor version.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.