LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices

Reply
 
Search this Thread
Old 03-11-2012, 12:33 PM   #1
irlogo
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Rep: Reputation: Disabled
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or director


Yum not work in my os ( Centos 5 )
Please help me

# yum
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory
 
Old 03-11-2012, 03:44 PM   #2
eeekster
Member
 
Registered: Sep 2011
Posts: 158

Rep: Reputation: Disabled
Do you have python installed?
 
Old 03-11-2012, 05:10 PM   #3
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,739

Rep: Reputation: 2550Reputation: 2550Reputation: 2550Reputation: 2550Reputation: 2550Reputation: 2550Reputation: 2550Reputation: 2550Reputation: 2550Reputation: 2550Reputation: 2550
Welcome to LQ.

You may have to reinstall python manually.
Yum and all the "system-config-" applications depend on python.

32bits http://mirror.centos.org/centos/5.8/...6.el5.i386.rpm
> python-2.4.3-46.el5.i386.rpm

64bits http://mirror.centos.org/centos/5.8/...el5.x86_64.rpm
> python-2.4.3-46.el5.x86_64.rpm

# rpm -Uvh --force python-2.4.3-46.el5.<arch>.rpm

.
 
Old 03-12-2012, 03:20 AM   #4
irlogo
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by knudfl View Post
Welcome to LQ.

You may have to reinstall python manually.
Yum and all the "system-config-" applications depend on python.

32bits http://mirror.centos.org/centos/5.8/...6.el5.i386.rpm
> python-2.4.3-46.el5.i386.rpm

64bits http://mirror.centos.org/centos/5.8/...el5.x86_64.rpm
> python-2.4.3-46.el5.x86_64.rpm

# rpm -Uvh --force python-2.4.3-46.el5.<arch>.rpm

.
Thank you

PHP Code:
# rpm -Uvh yum-*.rpm
Preparing...                ########################################### [100%]
        
package yum-fastestmirror-1.1.16-21.el5.centos.noarch is already installed
        package yum
-3.2.22-39.el5.centos.noarch is already installed
[root@server2 ~]# yum -y update
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -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, Feb 22 2012, 16:06:13)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)]

If 
you cannot solve this problem yourselfplease go to
the yum faq at
:
  
http://wiki.linux.duke.edu/YumFaq 
 
Old 03-12-2012, 04:05 AM   #5
John VV
Guru
 
Registered: Aug 2005
Posts: 12,953

Rep: Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719Reputation: 1719
irlogo

WHAT is it you are doing ?
your first post mentioned a python problem
CentOS REQUIRES the version of python in the CentOS update repo
yum & Gnome DEPEND on that specific version


if you manually change the OLDER version of python you WILL mess up Cent5

you were instructed to MANUALLY force the install of the correct python rpm

you then post something on REINSTALLING "yum" and "fastestmirror" from a manually downloaded rpm

yum was NOT the problem python is

WHAT is going on here ???


you did not fix the python problem
 
Old 03-12-2012, 04:38 AM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,739

Rep: Reputation: 2550Reputation: 2550Reputation: 2550Reputation: 2550Reputation: 2550Reputation: 2550Reputation: 2550Reputation: 2550Reputation: 2550Reputation: 2550Reputation: 2550
The rpm option "--force" must be used, if you want to repair / replace
a package with rpm.

'man rpm' : --force : Same as using --replacepkgs, --replacefiles

I.e. # rpm -Uvh --force yum-*.rpm

Any of these installed packages (yum dependencies) can stop yum,
if they have missing files, or have corrupt files : python,
rpm, yum-fastestmirror, python-urlgrabber, yum-metadata-parser,
python-elementtree, python-sqlite, python-iniparse, rpm-python.

.
 
  


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
/usr/bin/perl^M: bad interpreter: No such file or directory colindek Ubuntu 17 12-13-2011 09:32 AM
/usr/bin/perl^M: bad interpreter: No such file or directory colindek Linux - Newbie 8 12-12-2011 05:23 PM
[SOLVED] bash: /usr/local/bin/xdsi: /usr/bin/wish: bad interpreter: No such file or directory Berwhale Linux - Newbie 2 09-15-2011 02:59 PM
echo $PATH = /home/g3rc4n/bin:/usr/local/bin:/usr/bin:/bin:/usr/games ? i_heart_pandas Linux - Software 7 09-18-2009 08:33 AM


All times are GMT -5. The time now is 03:21 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration