Issue with YUM

General support questions
Post Reply
rit_netsys
Posts: 2
Joined: 2015/01/07 06:57:59

Issue with YUM

Post by rit_netsys » 2015/01/07 07:05:13

Hi,

I am facing issue with YUM. While trying to install something with YUM, its giving me below error -

[root@ritphedtest opt]# yum install phpMyAdmin
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory


I have checked Python Version also -

[root@ritphedtest opt]# whereis python
python: /usr/bin/python /usr/bin/python2.7 /usr/lib/python2.7 /usr/lib64/python2.7 /usr/local/bin/python2.7 /usr/local/bin/python2.7-config /usr/local/bin/python /usr/local/lib/python2.7 /usr/include/python2.7 /opt/fgs/bin/python /usr/share/man/man1/python.1.gz
[root@ritphedtest opt]# which python
/usr/local/bin/python
[root@ritphedtest opt]# ls -l /usr/local/bin/python
lrwxrwxrwx. 1 root root 24 Jan 7 12:26 /usr/local/bin/python -> /usr/local/bin/python2.7
[root@ritphedtest opt]# python --version
Python 2.7.6


I am using CentOS 7.

[root@ritphedtest opt]# uname -a
Linux 3.10.0-123.el7.x86_64 #1 SMP Mon Jun 30 12:09:22 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux



Need some help urgently.

User avatar
TrevorH
Forum Moderator
Posts: 29120
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Issue with YUM

Post by TrevorH » 2015/01/07 08:58:02

You've installed a source version of python in /usr/local/bin and it is being found first and overriding the system python 2.7.5. All the Redhat tools like yum are written in python and depend on the exact version as shipped by Redhat/CentOS - you cannot replace them. You'll need to uninstall the version you installed first. Depending on the damage that's done that might be all you need to do but you may also need to run hash -r to make bash forget that it once had a copy in /usr/local/bin and possibly even reinstall all the python RPM packages :-(
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 7 - General Support”