LinuxQuestions.org
Help answer threads with 0 replies.
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-11-2015, 03:15 AM   #1
jaishree17
LQ Newbie
 
Registered: Sep 2015
Posts: 5

Rep: Reputation: Disabled
centos yum help no module name yum


Hi,
I need help. I am new user of centos(centos6). I installed python 7.6 and the unknowingly I deleted the previous version 4.3.

As yum is developed on python

Now yum is not working I am getting error I tried several links but not get any solution which worked I am stuck what to do m not getting.



I am getting the below error for 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 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.7.6 (default, Jul 31 2015, 20:07:25)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)]

If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
 
Old 09-11-2015, 07:41 AM   #2
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 1,796

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
Where are you?

Did you try the step of downloading the latest yum source package for your centos version
[code]possibly using yumdownloader --source yum and running
Quote:
rpmbuild --rebuild yum*.src.rpm
as the FAQ advises?

What exactly have your already tried, and what happened?

Last edited by wpeckham; 09-11-2015 at 07:59 AM.
 
Old 09-11-2015, 07:53 AM   #3
jaishree17
LQ Newbie
 
Registered: Sep 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
I tried yours one also but it is throwing error:-


error: cannot open yum*.src.rpm: No such file or directory
 
Old 09-11-2015, 07:55 AM   #4
jaishree17
LQ Newbie
 
Registered: Sep 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
I tried to install python 2.4.3 version. But still yum is not working.
 
Old 09-11-2015, 08:18 AM   #5
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 1,796

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
One step at a time

Did you download the yum source package?
If so, what was the file name?
 
Old 09-11-2015, 08:33 AM   #6
jaishree17
LQ Newbie
 
Registered: Sep 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
No I have not downloaded.

Last edited by jaishree17; 09-11-2015 at 08:35 AM.
 
Old 09-11-2015, 08:54 AM   #7
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 1,796

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
One step as a time...

Ok, well the command you tried needs a file to work on. You must download the file before that can work.
You can download the file using that yumdownloader command.

Advantage, it gets the correct version for your distro, and uses the repos as the source. No searching for the right file.
 
Old 09-11-2015, 09:24 AM   #8
jaishree17
LQ Newbie
 
Registered: Sep 2015
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thank you, but from where I have to download? Is there any link?

yum is not working if I will download using yumdownloader will it work???
 
Old 09-12-2015, 09:37 AM   #9
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 1,796

Rep: Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619Reputation: 619
What I said

That yumdownload utility is part of the yum package tools, but does not depend upon yum. It is specifically designed to be useful in situations where yum is broken, though that is not the only use. If you use the command from the FAQ, or as I quoted from it above, you willget the proper source package.
 
Old 09-12-2015, 02:35 PM   #10
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,990

Rep: Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448Reputation: 2448
so you did a rookie face planting mistake

-- you will NOT do this again
this is why there are so many warnings

you will need to manually grab the CORRECT python from the cent base repo
and manually remove and copy/paste the correct python back in

first things first

? you can NOT locate the repo on line???????

odd
just fallow the links on the cent web site
Reading the directory tree has not changed since the 1980's
http://mirrors.arsc.edu/centos/
the ONLY supported version of 6 is 6.7
-- 64 bit
http://mirrors.arsc.edu/centos/6.7/os/x86_64/Packages/
download
"python-2.6.6-64.el6.x86_64.rpm "

use fileroller to open the rpm
it is basically a compressed archive
copy/paste the files to there correct location
( as normal you need to be root to do this)

clean the rpm database( this should now work )
Code:
su -
yum clean all 
rpm --rebuilddb
yum update
 
Old 09-12-2015, 05:25 PM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
@jaishree17 : 'yum' is a python application.
Can only use python-2.6.6 from the official CentOS 6 python packages: python + python-libs.
And 'yum' stops working when you are messing with python :
I.e. a manual install with 2.7.6 to /usr/ will overwrite the default files from both packages.


The rpm command still works :
If 32bits : # rpm -Uvh --force python-2.6.6-64.el6.i686.rpm
http://mirror.centos.org/centos/6.7/...4.el6.i686.rpm
python-libs : # rpm -Uvh --force python-libs-2.6.6-64.el6.i686.rpm
http://mirror.centos.org/centos/6.7/...4.el6.i686.rpm

64bits : # rpm -Uvh --force python-2.6.6-64.el6.x86_64.rpm
http://mirror.centos.org/centos/6.7/...el6.x86_64.rpm
python-libs : # rpm -Uvh --force python-libs-2.6.6-64.el6.x86_64.rpm
http://mirror.centos.org/centos/6.7/...el6.x86_64.rpm

Note1 : 'yum.py' is provided by the package 'sos' :
/usr/lib/python2.6/site-packages/sos/plugins/yum.py
... But can of course not be found when you are using a wrong Python version.

Note2 : If you ever want to experiment with an alien version of python :
Install it to "/opt/hideaway/alien-python/"

-

Last edited by knudfl; 09-12-2015 at 05:28 PM.
 
  


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 install flash ... yum: command not found ... which yum ... /usr/bin/yum tg3793 Fedora 8 04-13-2011 12:25 PM
how to update rhel 5 using centos yum updater without conflict with yum redhat plugin udayvikram Linux - Software 2 03-30-2010 09:15 AM
how to update rhel 5 using centos yum updater without conflict with yum redhat plugin udayvikram Linux - Newbie 1 03-29-2010 01:56 PM
problem when run yum (No module named yum) ezak Linux - Distributions 4 10-16-2009 05:04 AM
No module named rpm centos 4 yum dutchy88 Red Hat 6 01-25-2009 04:26 PM


All times are GMT -5. The time now is 05:56 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