The following problems may occur when you run Yum:
[Root@centos ~]# Yum
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 the above module doesn ' t match the
Current version of Python, which is:
2.5.4 (r254:67916, Feb 24 2010, 10:03:49)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]
If you are cannot solve this problem yourself, please visit http://www.92wiki.com
The Yum FAQ at:
Http://wiki.linux.duke.edu/YumFaq
Reason analysis: please visit http://www.92wiki.com
The CentOS 5.4 system default Python version is 2.4.3 and needs to be upgraded to Python 2.5.4, because Yum package management is written in Python, and just upgrading python alone can cause Yum to be unusable.
The main reason for this is that the newly installed Python does not have the packages that the Yum service relies on.
Workaround: Want to know more:
Find Yum file and edit this py file
[root@centos ~]# which yum
/usr/bin/yum
[Root@centos ~]# vi / Usr/bin/yum
To change
#!/usr/bin/python
to:
#!/usr/bin/python2.4
and then save OK.
There is also a possibility that the same can lead to the inability to use Yum, that is,/usr/bin python, Python2, python2.4 three files must not change. Theoretically, Yum is just based on the Python language, it has nothing to do with the version, but there are problems in the upgrade process, and I am not very clear about the specific mechanism.