Detailed steps for upgrading the Python version of centos

Source: Internet
Author: User
Detailed steps for upgrading the Python version of centos

 

@ For & ever 2010-07-06

 

The default Python version of centos is 2.4.
Now you need to upgrade python to version 2.5 or above (the same method for upgrading Python 2.6 ).
Because yum is heavily dependent on Python 2.4, we cannot delete the 2.4 version that comes with the original system.
(
You can also use the following solution: Modify the first line of/usr/bin/yum "#! /Usr/bin/Python "is "#! /Usr/bin/python2.4 "</usr/bin/python2.4 is the execution file of Python 2.4 backed up before Upgrade>
However, other thon2.4-dependent systems may still have problems.
).
Therefore, install python2.5 in a new directory.

 

Steps:


1. DownloadSource codePackage and decompress it

WgetHttp://www.python.org/ftp/python/2.5/Python-2.5.tar.bz2
Tar jxvf Python-2.5.tar.bz2
CD Python-2.5

Ii. Start Installation

./Configure -- prefix =/usr/local ### Note: install it in a new directory to avoid overwriting Python installed by default.
Make
Make install

Iii. Configuration

Ln-S/usr/local/bin/Python/usr/bin/python2.5

Iv. Test
Python
Go to the default Python installation in centos

 

Python2.5
Go to the python2.5 version we have installed.

In this way, we can retain two different Python versions in the system at the same time.

 

@ Forandever 2010-07-06

 

 

 

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.