When python is upgraded to 2.7.8, yum runs abnormally: No module named yum, 2.7.8yum
OS version:
[Root @ lixora etc] # cat redhat-release
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
--- Run yum to report an error
[Root @ lixora ~] # Yum install dialog
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
Current version of Python, which is:
2.7.8 (default, Jul 16 2014, 08:48:25)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)]
If you cannot solve this problem yourself, please go
The yum faq:
Http://wiki.linux.duke.edu/YumFaq
[Root @ lixora ~] # Rpm-qa | grep yum
Yum-security-1.1.16-21.el5
Yum-updatesd-0.9-2.el5
Yum-metadata-parser-1.1.2-3.el5
Yum-3.2.22-39.0.2.el5
Yum-rhn-plugin-0.5.4-26.0.1.el5
[Root @ lixora ~] # Whereis python
Python:/usr/bin/python2.4/usr/bin/python/usr/lib/python2.4/usr/include/python2.4/usr/share/man/man1/python.1.gz
[Root @ lixora ~] # Which yum
/Usr/bin/yum
[Root @ lixora ~] # Vi/usr/bin/yum
#! /Usr/bin/python2.4 ---- this line needs to be modified to/usr/bin/python2.4
Import sys
Try:
....
"/Usr/bin/yum" 32L, 806C written
----- Run yum again.
[Root @ lixora ~] # Yum install list
Loaded plugins: rhnplugin, security
This system is not registered with ULN.
ULN support will be disabled.
File: // media/oel/Server/repodata/repomd. xml: [Errno 5] OSError: [Errno 2] No such file or directory: '/media/oel/Server/repodata/repomd. xml'
Trying other mirror.
Setting up Install Process
No package list available.
---- Also update/usr/sbin/yum-updatesd
[Root @ lixora etc] # vi/usr/sbin/yum-updatesd
#! /Usr/bin/python2.4-tt
--- Restart the service
[Root @ lixora etc] # service yum-updatesd restart
Stopping yum-updatesd: [FAILED]
Starting yum-updatesd: [OK]