转自:http://www.weidianyuedu.com/
3.解决yum的python版本问题
但是我们还有最后一个问题要解决
但是因为yum是使用的python2.4的版本,所以 还需要修改一下(前面我们重命名的python_old现在派上用场啦)
[root@pythontab.com ~]# 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:
Python 2.7.8 (default, Dec 3 2014, 10:51:34)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-55)] on linux2
If you cannot solve this problem yourself, please go to
the yum faq at:
http://wiki.linux.duke.edu/YumFaq
[root@pythontab.com Python-2.7.8]# vim /usr/bin/yum
#!/usr/bin/python #修改此处为2.4的位置
[root@pythontab.com ~]# vim /usr/bin/yum
#!/usr/bin/python2.4
[root@pythontab.com ~]# yum
Loaded plugins: fastestmirror
You need to give some command
usage: yum [options] COMMAND
List of Commands:
check-update Check for available package updates
clean Remove cached data
deplist List a package’s dependencies
downgrade downgrade a package
erase Remove a package or packages from your system
groupinfo Display details about a package group
groupinstall Install the packages in a group on your system
grouplist List available package groups
groupremove Remove the packages in a group from your system
help Display a helpful usage message
info Display details about a package or group of packages
install Install a package or packages on your system
list List a package or groups of packages
localinstall Install a local RPM
yum 又可以使用了
至此python升级大功告成!