If you've simply over-written the rpm-provided files you may have... some pain later on; at the very least it's misleading for anyone who looks at the system.
In your position I'd do one of two things:
1/ Download the srpm for Centos, do an rpm -i openssl-whatever.srpm
Edit the /usr/src/redhat/SPEC/openssl.spec file to update the version and source file to the version of openssl you want to build.
Do an rpmbuild -ba /usr/src/redhat/SPEC/openssl.spec to build a newer version of the RPM. If all goes well you'll end up with some shiny new RPMs in /usr/src/redhat/RPMS/$arch and you can just drop them in.
or
2/ Nab the openssl srpm from a newer release (such as Fedora 12), and do an rpmbuild --rebuild openssl-whatever.srpm
Again, all going well you'll get some RPMs, although this is probably less reliable (in the sense that the ABI and dependencies may have changed from RHEL 5 to Fedora 12, for example).
The easiest way to upgrade Python on Linux is to have someone else do it for you; your distribution often has many people who package upgrades specifically for that distribution. Before you roll up your sleeves and get into it, see if they have already done the work.
Basically, this means learning what type of package manager your distribution uses, and then seeing if the next release is available. Weaknesses to this technique exist:
- Your distribution release might be old and updates are no longer available.
- Your distribution might value stability over cutting-edge, and has not yet decided the next release is stable enough (or adequately tested).
- Your distribution might not have packaged the needed modules, so you must install them yourself.
For my distribution, rpm
is the package manager, and yum is the command line front-end. To check if an update exists for a package with yum, I type
yum check-updates <package name>
and to update something I type
yum update <package name>
Whatever your outcome is with respect to your Python module, you should learn a bit about your package manager and how to use it to avoid the rush of needing to learn it at a critical juncture.
In the event that you do not find the right version packaged for you, sometimes a search on Google will yield a person who packaged the right version for your distribution, even though your distribution hasn't done so yet. If so, and if you trust the other person to not be doing something malicious, then you can typically install their package.
If no prepackaged version exists, then you are stuck and need to read the "how to install" pages of the particular item, and for Python, it closely reflects Maxime's "the hard way", which might sound intimidating, but after you do it a few times, you realize it isn't really that hard.
Keep in mind that software installed outside of the package manager's knowledge probably will never be known to the package manager, so future use of the package manager with respect to that software will probably need to be handled specially, to prevent the package manager from doing something that makes sense if your version of Python isn't installed.
Best Answer
Well, the short of it is that you can't (or at least shouldn't). A lot of CentOS (And RHEL) internal programs (including
yum
) depend upon 2.4...However, you can install 2.6 from the epel repository. The package is named
python26
, and the command is eitherpython26
orpython2.6
instead ofpython
... Note, don't change thepython
command to point topython26
for the above reason...