LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 05-17-2011, 03:51 PM   #1
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 322

Rep: Reputation: 30
Yum not working


Yum came working with my CentOS install and it no longer works:
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 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.6.2 (r262:71600, Sep 26 2009, 03:35:56)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)]

If you cannot solve this problem yourself, please go to
the yum faq at:
http://wiki.linux.duke.edu/YumFaq
Quote:
[root@server23 ~]# python
Python 2.6.2 (r262:71600, Sep 26 2009, 03:35:56)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import yum
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named yum
I found this same issue:
http://thinkinginsoftware.blogspot.c...named-yum.html
(Yes, I have CentOS 5.3)

So I tried getting the rpm again:
Quote:
wget http://vault.centos.org/5.2/os/i386/...s.1.noarch.rpm
15:44:12 (550 KB/s) - `yum-3.2.8-9.el5.centos.1.noarch.rpm' saved [595885/595885]
and installing it:
Quote:
[root@server23 ~]# rpm -Uvh yum-3.2.8-9.el5.centos.1.noarch.rpm
Preparing... ########################################### [100%]
1:yum ########################################### [100%]
But that didn't help at all. Same error about no such module.

Last edited by Zeno McDohl; 05-17-2011 at 03:53 PM.
 
Old 05-17-2011, 04:14 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Quote:
It's possible that the above module doesn't match the
current version of Python, which is: 2.6.2 ....
CentOS 5.x has python-2.4.3 : All admin tools depend on version 2.4.3,
which should never be changed.

You can however have an extra python(2.6), like /opt/python26/bin/python2.6,
but only one 'python' is allowed in the PATH : Must be 2.4.3 .

? ? May be you installed python26 from the EPEL repo ?
And renamed /usr/bin/python26 to 'python' ? ?

..

Last edited by knudfl; 05-17-2011 at 04:25 PM.
 
Old 05-17-2011, 04:37 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Another thing : yum-3.2.8-9.el5.centos.1.noarch is a CentOS 5.0 package.
CentOS 5.3 came with yum-3.2.19-18.el5.noarch.rpm.

And if you do updates :
The current version is "yum-3.2.22-33.el5.centos.noarch.rpm"
( = update 5.6 = CentOS 5.6 ).
 
Old 05-17-2011, 04:56 PM   #4
Zeno McDohl
Member
 
Registered: Apr 2005
Location: Saratoga, NY
Distribution: Slackware
Posts: 322

Original Poster
Rep: Reputation: 30
Oops fixed that:

Quote:
[root@server23 yum]# ls
yum-3.2.19-18.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-13.el5.centos.noarch.rpm yum-priorities-1.1.16-13.el5.centos.noarch.rpm
Quote:
[root@server23 yum]# rpm -Uvh yum*
Preparing... ########################################### [100%]
1:yum ########################################### [ 33%]
2:yum-fastestmirror ########################################### [ 67%]
3:yum-priorities ########################################### [100%]
I probably did upgrade yum which caused this then.

Quote:
[root@server23 yum]# /usr/bin/python26 --version
Python 2.6.2
 
  


Reply



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
yum install flash ... yum: command not found ... which yum ... /usr/bin/yum tg0000 Fedora 8 04-13-2011 11:25 AM
Yum not working at all due to /usr/bin/yum syntax error aheusdens Linux - General 1 04-09-2010 04:15 PM
YUM not working namit Linux - Software 2 11-17-2005 06:50 AM
Yum not working acidblue Fedora 3 10-24-2004 08:47 PM
Yum Not working ntesla Linux - Software 2 08-06-2004 09:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:34 PM.

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
Open Source Consulting | Domain Registration