[root@mysqls3 ~]# yum
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.3.4 (#1, Nov 4 2004, 14:06:56)
[GCC 3.4.2 20041017 (Red Hat 3.4.2-6.fc3)]
安装libxml2-python, python-sqlite, or python-elementtree package 三个包包以为问题解决,结果却还是出现No module named yum。
faq如下:
Q. 7: I installed a new version of yum (or upgraded my whole system) and now when I run yum, I get an error saying "The yum libraries do not seem to be available on your system for this version of python" and "Please make sure the package you used to install yum was built for your install of python." What's wrong with the yum package I've got, or my Python installation, and how do I fix it?
A.
In pre-2.3.? yum This error message is often misleading. To see the real error, run python from the command line, and type import yum. The problem probably isn't with your version of python at all, but with a missing libxml2-python, python-sqlite, or python-elementtree package.
Yum 2.4.x provides a different error with the module import errors, so this will become less confusing.
It also includes a directive to send the error to the mailing list. Really, you should figure out what rpm provides the module that was missing and try to install that.
If you are getting a message that yum itself is the missing module then you probably installed it incorreclty (or installed the source rpm using make/make install). If possible, find a prebuilt rpm that will work for your system like one from Fedora or CentOS. Or, you can download the srpm and do a
rpmbuild --rebuild yum*.src.rpm
Q. 8: Yum is very nice at updating my kernel, but I use the (nvidia | openafs | other module) and yum doesn't seem to handle it well. Could you fix yum to handle this for me?
A. This is a known and non-trivial problem, but people are talking and working on it. Please read ideas on [WWW] this plugin and messages from [WWW] the Google search of the yum archives to get more details.
[root@mysqls3 ~]# rpm -ivh /mnt/CentOS/RPMS/yum-2.4.3-4.el4.centos.noarch.rpm
warning: /mnt/CentOS/RPMS/yum-2.4.3-4.el4.centos.noarch.rpm: V3 DSA signature: NOKEY, key ID 443e1821
error: Failed dependencies:
urlgrabber is needed by yum-2.4.3-4.el4.centos.noarch
yum-metadata-parser is needed by yum-2.4.3-4.el4.centos.noarch
yumconf is needed by yum-2.4.3-4.el4.centos.noarch