遇到的问题:
[root@hadoop01 ~]# cat /etc/issue
Oracle Linux Server release 6.3
Kernel \r on an \m
[root@hadoop01 ~]# yum
Could not find platform independent libraries <prefix>Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
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.6.6 (r266:84292, Jun 18 2012, 09:14:33)
[GCC 4.4.6 20110731 (Red Hat 4.4.6-3)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
尝试解决
[root@hadoop01 ~]# python --version
Python 2.6.6
将#!/usr/bin/python修改为#!/usr/bin/python2.6
[root@hadoop01 ~]# vi /usr/bin/yum
#!/usr/bin/python2.6
问题依旧未解决
python-2.6.6-29.el6_2.2.x86_64.rpm
python-devel-2.6.6-29.el6_2.2.x86_64.rpm
python-libs-2.6.6-29.el6_2.2.x86_64.rpm
python-urlgrabber-3.9.1-8.el6.noarch.rpm
yum-3.2.29-30.0.1.el6.noarch.rpm
发现该机器上多安装了:python-devel-2.6.6-52.el6.x86_64,删除后问题解决。
[root@hadoop01 soft]# rpm -e python-devel-2.6.6-52.el6.x86_64 --nodeps
本文记录了在Oracle Linux Server 6.3上遇到的YUM无法正常工作的问题及其解决过程。主要原因是系统中存在版本冲突的Python开发库,通过删除多余的版本解决了问题。
3万+

被折叠的 条评论
为什么被折叠?



