Latest LQ Deal: Latest LQ Deals
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 03-25-2015, 09:10 AM   #1
LQ Newbie
Registered: Mar 2015
Posts: 2

Rep: Reputation: Disabled
Yum broken when updating python -Scientific Linux


I just updated my python to 2.7.6 and broke my yum link... It tried to follow different suggestion to solve this problem but nothing happen.

I have just used this tuto for updating my Python but the following command lines
# yum still needs 2.6, so write it in and backup script
sudo cp /usr/bin/yum /usr/bin/_yum_before_27
sudo sed -i s/python/python2.6/g /usr/bin/yum
sudo sed -i s/python2.6/python2.6/g /usr/bin/yum

have resulted in a bad interpreter error message when using yym command.
$ yum
bash: /usr/bin/yum : /usr/bin/python2.62.62.6 : mauvais interpréteur: Aucun fichier ou dossier de ce type
I don(t know how to change that!!

Any suggestion or help?
I am not a system administrator so I would need step by step help if this is possible

My system is Scientific Linux

Kind Regards
/ Lidilis
Old 03-25-2015, 01:31 PM   #2
Senior Member
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,039

Rep: Reputation: 1234Reputation: 1234Reputation: 1234Reputation: 1234Reputation: 1234Reputation: 1234Reputation: 1234Reputation: 1234Reputation: 1234
It means you ran the command multiple times. No problem.
With a text editor, change the first line of the file /usr/bin/yum from:

Old 03-25-2015, 02:47 PM   #3
John VV
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,612

Rep: Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649Reputation: 2649
well dah ...

yum is DEPENDENT !!!! on the default version already installed
that version MUST stay installed

this is a known thing for many YEARS

you can NOT replace it !!!!

now you CAN install a second newer version in a side by side set up
AS PER EVERY AND ALL documentation for RHEL / CentOS / SL

you are in a pickle / mess

chances are that you ALSO busted " rpm "and the database
to check run
su -
rpm -qa | grep yum
i am betting you get a error

if this is NOT a FULLY UP TO DATE!!! install you will have PROBLEMS!!!

UNINSTALL the version you installed !!!!!!! if possible ( you used pip )

manually ( in firefox) download the last update for python in the SL 6.6 repo

if rpm is by chance working
you might be able to have firefox install the rpm using rpm
or dl it
and do a FORCE!!! reinstall
su -
cd /to/location/of/rpm
rpm --force --install python-2.6.6-52.el6.x86_64.rpm
if rpm is broken -- likely
use file-roller in gnome to extract the rpm
and as root copy/paste the files in the correct place

then pray

and reboot

then try yum

Last edited by John VV; 03-25-2015 at 02:50 PM.
Old 03-26-2015, 04:52 AM   #4
LQ Newbie
Registered: Mar 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled


Nice answer John but not so constructive. Don't be so angry. I knew THAT!! It was the reason why I was following tuto from smart people that explains you how to do upgrade your python without loosing the default one. This was not anticipating that those tuto include errors in their command lines!!

So yum is functioning back on my server using those commands
## yum still needs 2.6, so write it in and backup script
sudo cp /usr/bin/yum /usr/bin/_yum_before_27
sed -i 's/python$/python2.6/g' /usr/bin/yum
sed -i 's/python2\.6[\.|0-9].*/python2.6/g' /usr/bin/yum
sed -i 's/python2\.[0-5|7-9].*/python2.6/g' /usr/bin/yum

Just in case someone has the same problem to solve.

Many thanks smallpond for your kind suggestion. This was another possiblity.

Have a nice day


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
[SOLVED] Updating python broke Yum & RPM steve_s Linux - Software 4 07-31-2014 04:17 PM
centos broken yum after installing new python mad_penguin Linux - Newbie 2 11-17-2011 05:36 PM
Broken YUM and Possibly Python nikunjbadjatya Linux - Software 3 06-17-2010 12:55 AM
Broken Yum while updating centos from 4.6 to 5.2 hoodedmanwithsythe Linux - Software 2 09-20-2008 02:59 AM
Yum broken Incorrect python version FC6 zeromaster Fedora 7 11-24-2007 08:54 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:06 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration