Linux

python 2.7.8 upgrade

Naan 2015. 1. 5. 21:16
반응형

python 구버전에서 최신버전으로 업데이트를 하자


# python -V

Python 2.4.3

구버전이다 최신버전으로 업데이트 하자

# wget --no-check-certificate -N http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tgz 
# tar xzf Python-2.7.8.tgz
# cd Python-2.7.8
# ./configure
# make
# make altinstall

# python -V

Python 2.4.3

여전히 구버전으로 나온다 최신버전으로 변경작업이 필요 하다.

# mv /usr/bin/python /usr/bin/python_old
# cp /usr/local/bin/python2.7 /usr/bin/python
# python -V
Python 2.7.8

정상적으로 버전이 나온다.

하지만 부작용이 있다 yum 이 정상구동이 안된다.
# yum
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   No module named yum

Please install a package which provides this module, or
verify that the module is installed correctly.

It's possible that the above module doesn't match the
current version of Python, which is:
2.7.8 (default, Jan  5 2015, 20:54:06)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]

If you cannot solve this problem yourself, please go to
the yum faq at:
  http://yum.baseurl.org/wiki/Faq

정상적으로 구동하려면
yum 을 기존 2.4 버전으로 롤백 해야 한다.

# vi /usr/bin/yum
#!/usr/bin/python
import sys
try:
    import yum
except ImportError:
~~~~~~~~~~~~~~~~~~~~~~

첫번째줄 부분을 수정해주면 된다.
#!/usr/bin/python     --> #!/usr/bin/python2.4  (구버전에 맞게 수정하면 된다.)

# yum 
하면 정상적으로 작동이 된다.




반응형

'Linux' 카테고리의 다른 글

sendmail 메일 제목,내용 해서 보내기  (0) 2015.01.21
intel raid web console 2 port  (0) 2015.01.15
CentOS 7.0 변경된점  (0) 2014.12.16
configure: error: no acceptable C compiler found in $PATH  (0) 2014.11.14
xrdpinstall  (0) 2014.11.10