Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Bash to install a customised version of JBoss, and one of the things I would like to do is install the correct version of the Apache Portable Runtime, which is a native binary.

This script could be run on both 32 and 64 bit versions of RHEL.

What are my options for identifying which version of the APR to install?

I think we only have 32bit and x64-based systems here. I would still like to identify i64 systems so that the script can refuse to install on that type of machine.

I am aware of using uname -m and grepping /proc/cpuinfo to find out, but was wondering which approach others would recommend?

share|improve this question
up vote 0 down vote accepted

If you're installing on RHEL systems, you should just use the native package management facilities -- such as yum -- to install APR. This will take care of architecture selection for you, and will make sure that any other dependencies are pulled in.

share|improve this answer
Thanks, but I'm not sure that'll work on our heavily-customised JBoss installation. The JBoss we're installing isn't being managed by yum, so I don't know if a yum-installed APR would work? The usual place to put APR is inside a folder on JBoss, though I suppose it could be configured to look elsewhere... – Rich Jan 6 '11 at 12:49
It should work, but if you've already got a process that you're using it's probably easiest to stick with it. If you really want/need to do it yourself, using uname -m as your determining factor is probably could also explicitly check to see if the 64 bit C library is installed (rpm -q glibc.x86_64). – larsks Jan 6 '11 at 14:24
Thanks for the update - in the end I went for the arch command as that's what a UNIX guy here recommended. I think arch does the same as uname -m, so I'm going to accept your answer :) – Rich Jan 7 '11 at 9:55

Your Answer


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.