CentOS5.4 on Python upgrade, the problem has been resolved yum unavailable (reprint)

1. Background

      CentOS5.4 comes with Python version is 2.4.3, but there are many versions of Python Python-based application software requirements should be higher than 2.4. (E.g., at least Robot Framework2.5 claim Python version 2.5)

2. Objectives

     The CentOS comes with Python upgrade from version 2.4.3 to version 2.6.5.

3. Implementation

 (1) download / install python

Download Python2.6.5.tar.bz2 (Download: http://www.python.org/ftp/python/2.6.5/Python-2.6.5.tar.bz2 )

$ Tar jxvf Python2.6.5.tar.bz2

$cd Python2.6.5

$./configure

$make && make install

Since then, the default installation path python2.6 in /usr/local/lib/python2.6

View Python Version:

$ /Usr/local/bin/python2.6 -V

 

 (2) establish a soft link, pointing to the system default python python2.6

Under normal circumstances, even if python2.6 after the installation is successful, the system defaults to the 2.4.3 version of the python still, considering that yum is based python2.4.3 to work, not easily unloaded. How to implement the system default python pointing to the 2.6 version of it?

mv /usr/bin/python  /usr/bin/python.bak

ln -s //usr/local/bin/python2.6 /usr/bin/python

Inspection python pointing to success

python -V

 

(3) to solve the system python after soft links pointing to python2.6 version, yum does not work

method:

$ V / Usr / bin / Yom

# / Usr will be displayed in the text editor / bin / python amended as # / usr / bin / python2.4, you can save the changes

Reproduced in: https: //www.cnblogs.com/licheng/archive/2010/12/06/1898441.html

Guess you like

Origin blog.csdn.net/weixin_33897722/article/details/92627201