LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   I have a problem With yum (https://www.linuxquestions.org/questions/linux-software-2/i-have-a-problem-with-yum-764084/)

com4host.com 10-23-2009 10:27 PM

I have a problem With yum
 
Hi.
I have a problem With yum

[~]# yum update
Traceback (most recent call last):
File "/usr/bin/yum", line 28, in ?
import yummain
ImportError: No module named yummain

distro running CentOS 5 32Bit
# uname -r
2.6.18-92.1.13.el5.028stab059.6



I hope to find help

Thank you.

jphilput 11-03-2009 01:30 PM

It looks like something has happened that is preventing Yum from accessing the information stored in /usr/share/yum-cli. There should be 3 files in that directory that have yummain in their names.

/usr/share/yum-cli/yummain.py
/usr/share/yum-cli/yummain.pyc
/usr/share/yum-cli/yummain.pyo

If these files are missing, then I would suggest reinstalling yum from a new set of RPMs. I have four yum related packages installed by default on my Centos 5 box, so if you reinstall Yum you may want to go ahead and pull these four packages.

yum
yum-fastestmirror
yum-metadata-parser
yum-updatesd

com4host.com 11-04-2009 02:28 AM

hi jphilput
can you help me for reinstalling yum

Thank you.

jphilput 11-06-2009 08:26 AM

I can give you some help with this, but if you don't already know how to add and remove packages without Yum, then I strongly recommend having and experienced systems administrator help with this. Removing and reinstalling Yum will, at least temporarily, break things. Everything *should* work fine after the reinstall, but it is possible that something else will break along the way. If you are not comfortable adding and removing packages, or do not have a lot of experience with Linux, I suggest that you get one of your local systems administrators to assist you before continuing with these instructions. If you do this wrong, you could potentially make your system inoperable.

Before you begin, you need to read and understand the RPM man page. RPM is the tool to use to manually add and remove packages.

First, we can try to manually update the yum packages and see if that solves the problem. Make sure you have downloaded the latest copies of the 4 files that I mentioned in my previous post, yum, yum-fastestmirror, yum-metadata-parser, and yum-updatesd. Once you have the latest files, run the following command as root:

# rpm -Uvh yum yum-fastestmirror yum-metadata-parser yum-updatesd

The command may generate errors, if it does, do your best to resolve them by downloading more up to date versions of the dependent packages, and adding them to the install command above. Once the command is run successfully, you should be able to use Yum. If you are still seeing the same error, then you will need to remove the existing Yum packages and reinstall them. Again, this should only be done as a last resort, with an experienced Linux systems administrator nearby and ready to help if things go badly. The following command will erase the Yum packages and alert you to any dependencies that will prevent the removal. During the test phase, DO NOT run this command as root, use a regular user account.

$ rpm -ev yum yum-fastestmirror yum-metadata-parser yum-updatesd

At this point there should be a list of dependencies that will be broken by making this change. You will need to download RPMs for each of the listed dependencies and add them to the rpm -ev command. Once it has stopped listing dependencies, su to Root, and run the completed command. Once it finishes running, you will need to run the following command to reinstall all of the packages that you removed. Make sure to add the dependencies to the end of the command.

# rpm -ivh yum yum-fastestmirror yum-metadata-parser yum-updatesd

Once everything is reinstalled, Yum should function normally.

com4host.com 11-07-2009 07:39 AM

when can i download the latest copies of the 4 files ?

Thank you to help me.

com4host.com 11-07-2009 08:44 AM

when can i download the latest copies of the 4 files ?

Thank you to help me.

jphilput 11-09-2009 09:33 AM

First, based on the questions that you have asked so far, I don't think that you should be the one to follow the instructions I've given here. Your username seems to indicate that you work for a hosting company. I think that you need to involve one of your systems administrators at this time.

In answer to your question, you can and should get the files from the same place that you downloaded CentOS.


All times are GMT -5. The time now is 03:40 PM.