Software Installation from Source
Because CentOS comes with a complete software development environment available to it, there are usually no important barriers to keep you from installing software out of a tar.gz or a tar.bz2 by unrolling and then compiling it. This is referred to as the ./configure ; make ; sudo make install way, which environments without good packaging systems are forced to use
But there are several good reasons for not doing so except if you absolutely have to. And there are some caveats you have to keep in mind
1. Contra
CentOS is about stability, not about bleeding edge software
- The software which comes with CentOS has been chosen for stability, which not only is true for the package itself, but also is about "playing well" with the other installed software.
- A common objection runs like this: But package foo in version x.y.1 has security holes which are gone in version x.z.1!
- That may be the case. But normally version x.z.1 also has new features over x.y.1 and those may break the expected behaviour of the software
Security updates are backported to the version which is installed in CentOS. You can check that with rpm -q --changelog package
- But I absolutely need foobar which doesn't ship with CentOS
Probably someone else has already packaged that for you. There are several CentOS maintained and also foreign packager Repositories with tons of prepackaged software running on CentOS.
But I need bazfoo in exactly version x.y.z!
You're most likely looking for a distribution which is more bleeding edge, or following a How To written by an unskilled author, as exact versions only matter rarely.
The newer version may well (or even: will) break other software depending on bazfoo in the shipped version; people aserting a need for the latest and greatest python or glibc often encounter this, because python and the core system libraries are so basic to most application layer packages in the CentOS distribution model. Sadly, simply building over top of existing packaged content usually mangled a system beyond repair, and a reinstall is necessary
2. Pro
If you absolutely cannot find the software you are looking for, then think about how you build and install the software
Packaging RPMs isn't very hard to do.
- If you package the software yourself, then it allows for easy updates, as you don't have to remember how you configured the software - it's in the spec file
- RPM knows about your software, so you can install other packages which depend on the software you just built
- It's easy to track dependencies, provides and requires
You can make your packages available to other people. Some Repositories are happy to add software which is packaged according to their guidelines
3. Caveats
DO NOT attempt to install software packages which are part of CentOS as a source package, because you think you absolutely need the newest version. THIS WILL OFTEN BREAK THINGS
Once you do proceed down this path, you have stepped out of the automatic security upgrade process which the distribution usually provides. It becomes incumbent upon you and you alone, to stay abreast of the fixes and patch your own source tree, recompile, reinstall etc.
If you really, really, really have to do so, then try to install it in parallel to the existing software, for example in /opt or in /usr/local/
If you need perl modules, DO NOT use CPAN, as that will most likely break your perl installation. Please try to package the perl module with either cpan2rpm or use the spec template for perl modules from fedora-rpmdevtools. The same advice goes for python. Many of the independent packagers have had to solve these issues before you, and you should consider their Repository for a binary or source RPM solution
The fedora-rpmdevtools are in the kbs-CentOS-Extras Repository. See Repositories. These may also help you with building normal rpms
4. Conclusion
Do not build software from source, use other Repositories if possible. If you have to build software: Roll your own packages. If you cannot roll your own packages: Install the software in a non-conflicting place. NEVER overwrite software which is shipped with CentOS
And remember: If you break it, you get to keep both pieces. There will be no support from the IRC-Channel, for example