LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
 
Search this Thread
Old 01-29-2014, 11:21 PM   #1
sanjay2004
Member
 
Registered: Dec 2004
Location: BIJAPUR
Posts: 86

Rep: Reputation: 15
yum repolist issue (yum not working on Centos 5)


I am trying to resolve the yum issue.

I am getting the below error,

[root@server19 opt]# yum repolist
'import site' failed; use -v for traceback
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.4.3 (#1, Sep 3 2009, 15:37:37)
[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
 
Old 01-30-2014, 03:59 PM   #2
Habitual
Senior Member
 
Registered: Jan 2011
Location: Pelican Bay Correctional
Distribution: I can't wait for Linux to be 'underground' again.
Posts: 3,928
Blog Entries: 1

Rep: Reputation: Disabled
and what does the YUM FAQ say to do?

What's the output of
Code:
yum repolist -v
When was the last time yum worked?
 
Old 01-30-2014, 06:17 PM   #3
John VV
Guru
 
Registered: Aug 2005
Posts: 14,191

Rep: Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918
Quote:
There was a problem importing one of the Python modules
yum and the gnone2 tie ins NEED !!! to have the version of python that in in the base repo and/or the updates repo
if you replace the very OLD version of python in the current ( older 5 series) CentOS 5.10

yum will STOP working


the issue you are having looks like that version of python was replaced

if that did happen
the ONLY way to fix it is to manually FORCE a reinstall of the correct version

normally this is done using yum
but with yum busted ......
it is back to "copy / paste"

hopefully this is still working
Code:
su -
rpm -qa | grep python
and this
Code:
python -V
( a CAP "V")
this versions MUST match the version in the rpm output

and for 5.10 , the only supported version.
it is
python-2.4.3-56.el5.i386.rpm

Last edited by John VV; 01-30-2014 at 06:21 PM.
 
Old 01-31-2014, 01:09 AM   #4
sanjay2004
Member
 
Registered: Dec 2004
Location: BIJAPUR
Posts: 86

Original Poster
Rep: Reputation: 15
Here is my o/p

[root@server19 Python-2.4.6]# yum repolist -v
'import site' failed; use -v for traceback
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.4.3 (#1, Sep 3 2009, 15:37:37)
[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


You have new mail in /var/spool/mail/root
[root@server19 Python-2.4.6]# rpm -qa | grep python
python-urlgrabber-3.1.0-5.el5
mod_python-3.2.8-3.1
gnome-python2-gnomevfs-2.16.0-1.fc6
python-devel-2.4.3-27.el5
gamin-python-0.1.7-8.el5
python-sqlite-1.1.7-1.2.1
gnome-python2-2.16.0-1.fc6
libxslt-python-1.1.17-2.el5_2.2
gnome-python2-gtksourceview-2.16.0-3.el5
dbus-python-0.70-9.el5_4
gnome-python2-gconf-2.16.0-1.fc6
gnome-python2-bonobo-2.16.0-1.fc6
gnome-python2-canvas-2.16.0-1.fc6
audit-libs-python-1.7.17-3.el5
gnome-python2-extras-2.14.2-6.el5
gtk-vnc-python-0.3.8-3.el5
python-iniparse-0.2.3-4.el5
notify-python-0.1.0-3.fc6
libselinux-python-1.33.4-5.5.el5
python-2.4.3-27.el5
python-numeric-23.7-2.2.2
python-elementtree-1.2.6-5
python-imaging-1.1.5-5.el5
gnome-python2-gnomeprint-2.16.0-3.el5
gnome-python2-gtkhtml2-2.14.2-6.el5
python-devel-2.4.3-27.el5
gnome-python2-libegg-2.14.2-6.el5
python-ldap-2.2.0-2.1
gnome-python2-applet-2.16.0-3.el5
gnome-python2-desktop-2.16.0-3.el5
libxml2-python-2.6.26-2.1.2.8
rpm-python-4.4.2.3-18.el5
[root@server19 Python-2.4.6]#
 
Old 01-31-2014, 01:45 AM   #5
John VV
Guru
 
Registered: Aug 2005
Posts: 14,191

Rep: Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918
---- fixing a mistake ----

try this
you are going to have to fix the installed python
this is the current
http://mirror.rackspace.com/CentOS/5...6.el5.i386.rpm
download it and run on it
Code:
su -
cd /to/the/location/you/saved/it
rpm --force -i --nodeps python-2.4.3-56.el5.i386.rpm
if that dose not install it is possible to use file roller to extract the compressed archive and manually "copy / paste " the parts to the correct location


by this i take it you tried replacing the required version of python
Quote:
[root@server19 Python-2.4.6]
with a source build of 2.4.6


you can install a newer version of python SIDE BY SIDE
but you can NOT replace the needed version

Last edited by John VV; 01-31-2014 at 02:00 AM.
 
Old 01-31-2014, 02:35 AM   #6
sanjay2004
Member
 
Registered: Dec 2004
Location: BIJAPUR
Posts: 86

Original Poster
Rep: Reputation: 15
John, U r correct, i tried the updated one.

see the current trial, it installed with not error.

but its continued with yum error. i have seed on one portal to install with cd. could you brief the steps.

here is my 2nd trial

[root@server19 opt]# uname -a
Linux server19.jublbiosys.com 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:14 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@server19 opt]# rpm --force -i --nodeps python-2.4.3-56.el5.x86_64.rpm
[root@server19 opt]# yum repolist
'import site' failed; use -v for traceback
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.4.3 (#1, Sep 3 2009, 15:37:37)
[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


[root@server19 opt]# python -v
# installing zipimport hook
import zipimport # builtin
# installed zipimport hook
'import site' failed; traceback:
ImportError: No module named site
Python 2.4.3 (#1, Sep 3 2009, 15:37:37)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

[root@server19 opt]# python -V
Python 2.4.3
[root@server19 opt]#

Last edited by sanjay2004; 01-31-2014 at 02:38 AM.
 
Old 01-31-2014, 02:54 PM   #7
John VV
Guru
 
Registered: Aug 2005
Posts: 14,191

Rep: Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918
well it is also possible that you UNINSTALLED "yum"

did you ?

if you do not know if you did than

have a look at the yum log
/var/log/yum.log
 
Old 02-04-2014, 05:08 AM   #8
sanjay2004
Member
 
Registered: Dec 2004
Location: BIJAPUR
Posts: 86

Original Poster
Rep: Reputation: 15
[root@server19 ~]# cat /var/log/yum.log
[root@server19 ~]# rpm -q yum
yum-3.2.22-26.el5.centos
[root@server19 ~]#
 
Old 02-04-2014, 10:03 PM   #9
sanjay2004
Member
 
Registered: Dec 2004
Location: BIJAPUR
Posts: 86

Original Poster
Rep: Reputation: 15
I am trying to upgrade the OS

[root@server19 ~]# su -c 'yum update'
'import site' failed; use -v for traceback
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.4.3 (#1, Sep 3 2009, 15:37:37)
[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

Existing:
[root@server19 ~]# cat /etc/redhat-release
CentOS release 5.5 (Final)
[root@server19 ~]#
 
Old 02-05-2014, 12:05 AM   #10
John VV
Guru
 
Registered: Aug 2005
Posts: 14,191

Rep: Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918
how and where did you install the ptyhon you built from source

you will need to uninstall the source build
Code:
make uninstall
then manually copy / paste from the extracted rpm archive the python in the centos 5.10 update repo
apparently the rpm command did not install it

and do the same for any other python related software you build from source
 
Old 02-26-2014, 05:57 AM   #11
sanjay2004
Member
 
Registered: Dec 2004
Location: BIJAPUR
Posts: 86

Original Poster
Rep: Reputation: 15
Again I am backp with same prob,

[root@server19 ~]# rpm -e yum
error: Failed dependencies:
yum >= 3.0 is needed by (installed) yum-fastestmirror-1.1.16-14.el5.centos.1.noarch
yum >= 3.2.0 is needed by (installed) yum-updatesd-0.9-2.el5.noarch
yum >= 3.2.5-2 is needed by (installed) pirut-1.3.28-20.el5.centos.noarch
[root@server19 ~]#
 
  


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
yum repolist details rebelbuttmunch Linux - Software 3 09-20-2011 03:54 PM
yum repolist asifh.sayed Red Hat 2 09-20-2011 10:49 AM
yum install flash ... yum: command not found ... which yum ... /usr/bin/yum tg3793 Fedora 8 04-13-2011 11:25 AM
how to update rhel 5 using centos yum updater without conflict with yum redhat plugin udayvikram Linux - Software 2 03-30-2010 08:15 AM
how to update rhel 5 using centos yum updater without conflict with yum redhat plugin udayvikram Linux - Newbie 1 03-29-2010 12:56 PM


All times are GMT -5. The time now is 09:53 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration