Python upgrades a workaround that causes the Yum command to be unusable (modified version) __python

Source: Internet
Author: User
1, the error information is as follows:
[Root@develop bin]# yum [root@develop local]# yum-y Install Prce There was a problem importing one of the
Python Modules
required to run yum. The error leading to this problem is:


   No module named Yum please


install a package which provides this module, or Verify that's the
module is installed correctly.


It's possible that's above module doesn ' t match the current
version of Python, which is:
2.6.1 (r261:67515, Aug 7 11:36:17)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] If you


cannot solve this problem yourself The
Yum FAQ at:
Http://wiki.linux.duke.edu/YumFaq




Error Reason: The error message is described as incompatible with Python that Yum relies on, please install the corresponding Python


2, view Yum version
[Root@develop local]# Rpm-qa |grep Yum
Yum-3.2.8-9.el5.centos.1
Yum-metadata-parser-1.1.2-2.el5


3. View Python version
[Root@develop local]# whereis python
python:/usr/bin/python2.4/usr/bin/python/usr/lib/python2.4/usr/local/bin /python2.6/usr/local/bin/python2.6-config/usr/local/bin/python/usr/local/lib/python2.6/usr/share/man/man1/ Python.1.gz



Sure enough, two versions of Python were installed.


4, execute Python, see the version that uses 2.6.1
[Root@develop local]# python
python 2.6.1 (r261:67515, Aug 7, 11:36:17)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44 ] on linux2
Type ' help ', ' copyright ', ' credits ' or ' license ' for the more information.
>>>




5, guess Yum called the high version of Python.


6, the solution:
Find Yum and Yum-updatest files, and edit this py file
[Root@develop local]# which yum
/usr/bin/yum
[root@develop local]# Vi/usr/bin/yum
[Root@develop local]# Vi/usr/bin/yum-updatest



Will
#!/usr/bin/python
To
#!/usr/bin/python2.4


Then save OK.

If you do not modify/usr/bin/yum, Yum cannot use

If you do not modify/usr/bin/yum-updatest, you will receive the following error

File "/usr/sbin/yum-updatesd", line <module>
Import Dbus
Importerror:no module named Dbus



Of course, after the revision of the PostScript

[Root@localhost google_appengine]#/sbin/service yum-updatesd Restart stopping yum-updatesd
:                                     [FAILED]
Starting yum-updatesd:                                     [  OK  ]


Add: Yum is based on Python.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.