LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   yum corrupted (https://www.linuxquestions.org/questions/linux-newbie-8/yum-corrupted-811221/)

mosen81 05-31-2010 04:04 AM

yum corrupted
 
Hi, im new to Linux. Right now im doing some development in RedHat EL5. I cant use yum to install any package or update. Everytime i typed yum the error is:

Traceback (most recent call last):
File "/usr/bin/yum", line 28, in ?
import yummain
File "/usr/share/yum-cli/yummain.py", line 30, in ?
from yum import _
ImportError: cannot import name _

I cant even run "yum clean metadata". I've dowloaded and installed yum-3.2.27 but the problem is still the same.

This is my yum.conf:

[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3

Need some step by step help as im totally new to this. Thanks in advance.

alli_yas 05-31-2010 05:03 AM

Hi

Welcome to LQ!

I suggest you read the LQ Rules and "How to ask questions the smart way" which can be found on the Forum home page.

Regarding your question/s:

Quote:

Need some step by step help as im totally new to this. Thanks in advance
This is not how LQ works - here we believe in helping people to educate themselves; not to give step by step guides to doing things. So by all means attempt to solve your problem and at each stumbling block we will help you as best we can.

Regarding the yum issue that you're experiencing; I have 2 comments/suspicions:

1. You should not have downloaded and installed version 3.2.27 of yum - the latest supported version of yum for RHEL is version 3.2.22. Installing an unsupported package can have implications to your support agreement with Red Hat.

2. Based on your output, it appears that some of the dependencies for yum are missing - take a look at this for a user who had a similar experience: http://old.nabble.com/yum-error-Impo...d18624933.html

lazlow 05-31-2010 11:37 AM

Mosen

When you are working on an RPM based distro it is best NOT to install from source. The packages are just too tightly integrated. IF you wish to build you own applications(or whatever) learn how to build RPMs and install the RPM instead of installing source. The reason for this is that when you install from source the RPM db does not know about what you installed, it just knows about RPMs. The problem arises when the RPM versions of packages(not necessary related to what you are doing) start calling for things that you have installed via source. Now if the source version does not behave EXACTLY as the RPM version you are superseding, it can (and does) cause problems. Depending on what you have installed this can snowball into a huge mess in very short order. One would think that one could just use the uninstall script from the source that you built from, unfortunately this seldom works. If you build the RPM, rather than just installing it from source, and a conflict arises the package manager is then able to completely remove the offending package(usually without much of an issue).

Edit: You should also tell us what version of el5 you are running(5.0-5.5 are currently choices) and what arch you are using(i386,x64, etc), whenever you ask a question.

mosen81 05-31-2010 08:05 PM

Thanks for the advices. Added info; the RedHat version is "Linux version 2.6.18-8.el5" and using i386 archi.

John VV 05-31-2010 10:35 PM

for red hat you NEED to but a support license .This enables you to install the red hat updates and access to the red hat software repos.
pay red hat and ask them
----- OR ---------
install CentOS 5.5
Cent is a community supported version of red hat

mosen81 05-31-2010 10:41 PM

I just did "rpm -Uvh --force yum-3.2.22-4.el5.noarch.rpm" and yum is back on track. Thanks all.

lazlow 05-31-2010 10:44 PM

mosen81

Post the results of:
Quote:

cat /etc/redhat-release
What you posted(2.6.18-8.el5) is just the kernel version. I suspect that you are still running 5.0 while the current is 5.5. Just to give you an idea how far behind you are the current kernel is 2.6.18-194.3.1.el5 and new kernels do not come out very often on el5. There is a ton of fixes between -8 and -194. John VV is correct in that you cannot access any RHEL updates unless you pay the subscription. If you do not wish to pay then switching to Centos is a VERY good idea.

mosen81 05-31-2010 11:11 PM

[root@localhost /]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5 (Tikanga)

Unfortunately this machine is not my personal. Its a company server that being provided for us to develop subversion system, reviewboard etc. I cant afford to pay or change it to CentOS.

John VV 06-01-2010 12:40 AM

mosen81 if your company can not be bothered to pay for the last aprox. 2 years of security updates then your system will/ or is / "cracked"
some cracker will have control over it .

unSpawn 06-06-2010 05:03 PM

Do not do that again!
 
Quote:

Originally Posted by John VV (Post 3988166)
mosen81 if your company can not be bothered to pay for the last aprox. 2 years of security updates then your system will/ or is / "cracked"
some cracker will have control over it .

Unless you have access to any "evidence" we don't I strongly suggest you keep from making claims like that as it's close to posting FUD.


All times are GMT -5. The time now is 12:42 AM.