LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   -bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or director (https://www.linuxquestions.org/questions/red-hat-31/bash-usr-bin-yum-usr-bin-python-bad-interpreter-no-such-file-or-director-933911/)

irlogo 03-11-2012 12:33 PM

-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

eeekster 03-11-2012 03:44 PM

Do you have python installed?

knudfl 03-11-2012 05:10 PM

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

.

irlogo 03-12-2012 03:20 AM

Quote:

Originally Posted by knudfl (Post 4624243)
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 


John VV 03-12-2012 04:05 AM

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

knudfl 03-12-2012 04:38 AM

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.

.


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