今天要用yum安裝軟件,因而yum install ***,可是報錯,錯誤以下:python
There was a problem importing one of the Python modules required to run yum. The error leading to this problem was:linux
No module named yumvim
Please install a package which provides this module, or verify that the module is installed correctly.python2.7
It’s possible that the above module doesn’t match the current version of Python, which is:
If you cannot solve this problem yourself, please go to the yum faq at:ide
http://wiki.linux.duke.edu/YumFaqui
我開始還覺得是yum沒安裝,因而:this
#rpm -qa|grep yum
yum-updatesd-0.9-2.el5
yum-metadata-parser-1.1.2-4.el5
yum-utils-1.1.16-21.el5
yum-rhn-plugin-0.5.4-26.el5
yum-security-1.1.16-21.el5
yum-3.2.22-40.el5
# rpm -ivh yum-3.2.22-40.el5
error: open of yum-3.2.22-40.el5 failed: No such file or directoryget
安裝不了,因而網上搜有了一下發現是python依賴錯誤。修改以下:it
#whereis pythonio
python: /usr/bin/python /usr/bin/python2.4 /usr/bin/python.bak /usr/lib/python2.4 /usr/local/bin/python /usr/local/bin/python2.7-config /usr/local/bin/python2.7 /usr/local/lib/python2.7 /usr/include/python2.4 /usr/share/man/man1/python.1.gz
修改文件: vim /usr/bin/yum
修改頭#!/usr/bin/python => #!/usr/bin/python2.4
Ok,問題搞定