LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-17-2009, 10:07 AM   #1
onesikgypo
Member
 
Registered: Jun 2008
Posts: 56

Rep: Reputation: 15
Yum problem with CentOS - help please


Hi,

I was updating my machine, and successfully ran "yum update"

now after this i installed the rpmforge repo following:

http://wiki.centos.org/AdditionalRes...ories/RPMForge

after that i ran "yum update" once more,a nd it found a few files.

Now after this when i tried yum i got the following error:

Code:
# 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 cElementTree

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.4.3 (#1, Jul 27 2009, 17:57:39)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]

If you cannot solve this problem yourself, please go to
the yum faq at:
  http://wiki.linux.duke.edu/YumFaq


i couldnt figure out why, so i checked the latest rpm packages that were installed:

Code:
# rpm -qa --last
udftools-1.0.0b3-3.2.el4.rf                   Thu 17 Sep 2009 05:26:04 PM CEST
python-elementtree-1.2.6-7.el4.rf             Thu 17 Sep 2009 05:26:04 PM CEST
mtr-0.73-1.el4.rf                             Thu 17 Sep 2009 05:26:04 PM CEST
dnsmasq-2.50-1.el4.rf                         Thu 17 Sep 2009 05:26:04 PM CEST
rsync-3.0.6-1.el4.rf                          Thu 17 Sep 2009 05:26:03 PM CEST
openssl097a-0.9.7a-9.el5_2.1                  Thu 17 Sep 2009 05:26:03 PM CEST
nmap-5.00-1.el4.rf                            Thu 17 Sep 2009 05:26:03 PM CEST
lftp-3.7.15-1.el4.rf                          Thu 17 Sep 2009 05:26:03 PM CEST
compat-readline43-4.3-3                       Thu 17 Sep 2009 05:26:03 PM CEST
gpg-pubkey-6b8d79e6-3f49313d                  Thu 17 Sep 2009 05:22:44 PM CEST
rpmforge-release-0.3.6-1.el4.rf               Thu 17 Sep 2009 05:22:21 PM CEST
gpg-pubkey-e42d547b-3960bdf1                  Thu 17 Sep 2009 05:22:21 PM CEST
gpg-pubkey-6b8d79e6-3f49313d

i uninstalled all of these via rpm -e . Yum still didnt work.

so i then removed yum from my system and deleted /var/cache/yum and /etc/yum.repos.d

now if i try to install: yum-1.0.3-0.1.rf.src.rpm

i get this

Code:
root@localhost home]# rpm -Uvh yum-1.0.3-0.1.rf.src.rpm
   1:yum                    warning: user dag does not exist - using root
warning: group dag does not exist - using root
warning: user dag does not exist - using root 96%)
warning: group dag does not exist - using root
########################################### [100%]
[root@localhost home]# yum
-bash: /usr/bin/yum: No such file or directory
if i try to install: yum-1.0.3-0.1.rh7.rf.noarch.rpm

i get this:

Code:
[root@localhost home]# rpm -Uvh yum-1.0.3-0.1.rh7.rf.noarch.rpm
Preparing...                ########################################### [100%]
   1:yum                    ########################################### [100%]
[root@localhost home]# yum
Traceback (most recent call last):
  File "/usr/bin/yum", line 22, in ?
    import yummain
ImportError: Bad magic number in /usr/share/yum/yummain.pyc
if i remvoe that and try to install: yum-3.2.19-18.el5.centos.noarch.rpm

i get:

Code:
[root@localhost home]# rpm -Uvh yum-3.2.19-18.el5.centos.noarch.rpm
error: Failed dependencies:
        python-elementtree is needed by yum-3.2.19-18.el5.centos.noarch
        yum-fastestmirror is needed by yum-3.2.19-18.el5.centos.noarch
        yum-metadata-parser >= 1.1.0 is needed by yum-3.2.19-18.el5.centos.noarch
Any help would be greatly appreciated, thankyou
 
Old 09-17-2009, 10:43 AM   #2
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 5.4, Mac OS 10.4 (tiger)
Posts: 1,005

Rep: Reputation: 79
I dread to think what you have done.

The original problem is that python lost or had a module corrupted and the fix from the start would have been to reinstall python from an .rpm, unfortantly I don't know what version of python that CentOS uses off the top of my head...
 
Old 09-17-2009, 11:48 PM   #3
onesikgypo
Member
 
Registered: Jun 2008
Posts: 56

Original Poster
Rep: Reputation: 15
For anyon who happens to have the same problem happen to them, i managed to fix everything back to normal - after the above steps i then:

1) reinstalled python-elementtree
2) installed yum-3.2.19-18.el5.centos.noarch.rpm & yum-fastestmirror & yum-fastestmirror at the same time (single command)

3) copied back CentOS-Base and CentOS-Media repos back into the repos dir (/etc/yum.repos.d)

After that everything returned back to normal. Though i dont think ill be running yum update again.
 
Old 10-21-2009, 10:00 AM   #4
erinaceus
LQ Newbie
 
Registered: Oct 2009
Posts: 2

Rep: Reputation: 0
hi all,

i had this problem today and i solved it.

system CentOS 5.3
Here is the way i followed.

1 - first. i had this report:
Quote:
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

No module named cElementTree

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.4.3 (#1, Jul 27 2009, 17:56:30)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]

If you cannot solve this problem yourself, please go to
the yum faq at:
http://wiki.linux.duke.edu/YumFaq
2- i looked at /etc/yum.conf
here is what i see on the log.
Quote:
Oct 21 12:07:49 Installed: php-mcrypt-5.2.11-2.el5.x86_64
Oct 21 15:37:25 Updated: apr-1.3.8-1.el5.x86_64
Oct 21 15:37:25 Updated: apr-util-1.3.9-1.el5.x86_64
Oct 21 15:37:25 Installed: apr-util-ldap-1.3.9-1.el5.x86_64
Oct 21 15:37:26 Updated: httpd-tools-2.2.14-1.el5.x86_64
Oct 21 15:37:27 Updated: httpd-2.2.14-1.el5.x86_64
Oct 21 15:37:27 Installed: libmhash-0.9.1-1.2.el5.rf.x86_64
Oct 21 15:37:28 Updated: 1:mod_ssl-2.2.14-1.el5.x86_64
Oct 21 15:37:28 Updated: htop-0.8.3-1.el5.rf.x86_64
Oct 21 15:37:28 Updated: python-elementtree-1.2.6-7.el4.rf.x86_64
Oct 21 15:37:28 Updated: apr-devel-1.3.8-1.el5.x86_64
Oct 21 15:37:29 Updated: apr-util-devel-1.3.9-1.el5.x86_64
Oct 21 15:37:29 Installed: perl-Net-Daemon-0.44-7.el5.noarch
Oct 21 15:37:29 Installed: perl-PlRPC-0.2020-1.el5.rf.noarch
Oct 21 15:37:30 Updated: perl-DBI-1.609-1.el5.rf.x86_64
Oct 21 15:37:30 Installed: perl-DBD-mysql-4.012-1.el5.rf.x86_64
Oct 21 15:37:30 Updated: httpd-devel-2.2.14-1.el5.x86_64
Oct 21 15:37:33 Updated: kernel-headers-2.6.18-164.2.1.1.el5.x86_64
Oct 21 15:37:33 Erased: perl-DBD-MySQL
Oct 21 15:37:33 Erased: mhash
3 - the bold line blinks on my mind. and i searched for it and found that it is not compatible with my system.

4 - than i searched rpm search, found compatible version here.
http://rpm.pbone.net/index.php3/stat.../field[]/2

5 - wget it and rpm it.

thank voila! ... it works.

Thanks a lot Open Source.

I dont need a ticket. my answers are everywhere. like real world.
 
Old 10-21-2009, 09:30 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Given that your system seems to be composed of el5 (RHEL 5 compat) rpms, & that one is marked el4(!), I'm not surprised it had a problem...
 
Old 03-14-2011, 06:58 AM   #6
john.wythe@activant.com
Member
 
Registered: Nov 2009
Location: Burnaby BC
Posts: 59

Rep: Reputation: 1
Fixing yum repos to avoid incorrect rpms

I ran into the same problem as listed above, except my log listed el3 for the rpmforge package instead of el4. I did the same thing as the last person to fix the problem.
I then looked at my rpmforge repos in /etc/yum.conf.d. They were all set to look at el3 instead of el5.
I changed them all the be el5.
Then did an yum update. This loaded a new rpmforge-release prm for el5. It saved my existing rpmforge files in /etc/yum/conf.d with a .rpmsave added to the name. I did a compare on the saved withs with the installed ones and they were all the same which is good.

I then ran a yum list installed| fgrep el3
This showed a number a packages.
I did a rpm --erase --nodeps on each one, and then did a yum install of the same package. This resulted in installing the correct el5 package.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with Yum update-install-list on CentOS 5.2 reyhaneh.emi Linux - Newbie 4 05-23-2009 04:56 AM
problem with Yum update-install-list on CentOS 5.2 reyhaneh.emi Linux - Software 1 05-20-2009 03:25 PM
yum update problem, centos 4.92 repo no longer available parv Linux - Distributions 3 04-15-2007 08:10 PM
Problem with yum in CentOS 4.3 combilli Linux - Software 2 10-31-2006 04:39 AM
Major problem with yum/centos 4.2 and remote desktop Lleb_KCir Linux - Software 7 11-22-2005 09:50 AM


All times are GMT -5. The time now is 05:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration