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'm using Amazon Linux AMI, which seems to be some RHEL or CentOS offshoot. I've read that it should be binary compatible with RHEL. My question is: is there any advantage to compile a package from source as opposed to using the RHEL or CentOS repos (as they should work too)?

share|improve this question
up vote 6 down vote accepted

In theory compiling your own source could take advantage of particular compiler optimizations that leverage your hardware. In practice for most applications it doesn't make a tangible difference - particularly when compared to the issues associated with dependencies, updates, testing, etc. This advantage also presupposes a compiler that can optimize for the features in question which is by no means a given.

There's a semi-famous quote by Donald Knuth:

"Programmers waste enormous amounts of time thinking about, or worrying about, the speed of noncritical parts of their programs, and these attempts at efficiency actually have a strong negative impact when debugging and maintenance are considered. We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil. Yet we should not pass up our opportunities in that critical 3%."

At this point rolling your own binaries for the purposes of performance would definitely fall into this category. There are times when particular features that aren't in distributions might be needed (for example) but these cases should be few and far between.

share|improve this answer

There are disadvantages in as much as the official packages are tested, supported and security patches are backported to them. By compiling your own you are stepping outside of this network and at the very least not have to rely on more than one maintainer group to supply patches.

share|improve this answer

Compiling From source gives you more recent version than from repositories,it might include some bug fixes. but its not a best security practice to install compilers on production servers.

share|improve this answer

Building from source usually gets you the latest version and you can try beta versions as well. However, using packages gets you well tested and stable versions. Depends on your needs.

share|improve this answer

By compiling you can optimize for your hardware, as others also said, or enable features not in the binary packages.

But having custom packages compiled from source can be harder to maintain. You have to check for updates, and security issues by yourself and compile the new version when needed.

share|improve this answer

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.