LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 07-31-2014, 09:04 AM   #1
steve_s
LQ Newbie
 
Registered: Sep 2007
Posts: 13

Rep: Reputation: 1
Updating python broke Yum & RPM


Hello,

I am running Linux 3.15.5-200.fc20.x86_64.

I updated Python2 to 2.7 by Yum, and installed Python3 v3.3 from source, before I discovered I could no longer use Yum. The python installations are in

Code:
  /usr/lib/python2.7
  /usr/lib/python3.3
The symblic links in /usr/bin had changed to point to python3, so I restored the links as follows

Code:
  /usr/bin/python -> /usr/bin/python2
  /usr/bin/python2 -> /usr/bin/python2.7
  /usr/bin/python3 -> /usr/bin/python3.3
This did not mend it. I tried to uninstall/reinstall Python & Yum through RPM, found that RPM is also broken. rpm -q and rpm -e hang with ps showing process status 'S', interruptible sleep. rpm --help and rpm --version work and exit cleanly.

I edited the !#/usr/bin/python lines to read !#/usr/bin/python2 in all the files that I could find to do with Yum and RPM that invoke Python,

Code:
  /usr/bin/yum
  /usr/share/yum-cli/*.py
  /usr/lib/python2.7/site-packages/rpmUtils/transaction.py
then ran python2 -m compileall, to update *.pyc. This did not mend it, so I restored the these files to their original state. I tried to install rpm from source but ran up against nss dependencies

So I have broken Yum and I can't use rpm to mend it, since that too is broken. Can anyone advise please?
 
Old 07-31-2014, 01:24 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,602

Rep: Reputation: 2648Reputation: 2648Reputation: 2648Reputation: 2648Reputation: 2648Reputation: 2648Reputation: 2648Reputation: 2648Reputation: 2648Reputation: 2648Reputation: 2648
run "make uninstall" on the python3 source
and manually reinstall the default python rpm's
yum MUST!!!!!!! have the default 2.7 installed !!!!!!!!

but
you can run a newer version side by side

and python3 IS in the fedora repos ( and will install without KILLING yum)

there was no need to use a source build



the python27 rpm is in the updates
a link to a mirror -- 64 bit
http://mirror.pnl.gov/fedora/linux/updates/20/x86_64/
python-2.7.5-13.fc20.x86_64.rpm

File-roller can extract the files in the rpm
copy/paste them to there locations

Last edited by John VV; 07-31-2014 at 01:29 PM.
 
1 members found this post helpful.
Old 07-31-2014, 02:34 PM   #3
steve_s
LQ Newbie
 
Registered: Sep 2007
Posts: 13

Original Poster
Rep: Reputation: 1
Thanks John VV, I have now tried what you suggest, but the 3.3.2 Makefile has no uninstall target.
I can find no reference on Python website to uninstalling Python.

I tried installing 2.7.8 from source, to see if I could overwrite the damage, but got no solution.
Incredibly, the 2.7.8 Makefile has no uninstall target either, and no reference to anything that I
can identify as being like uninstall.

The only help I read about is to use the package managers, but since Yum & RPM are out of order I
am at a loss.

I straced an rpm operation to see if python was the obvious problem. The last lines of the tracefile was

Code:
open("/var/lib/rpm/.dbenv.lock", O_RDWR|O_CREAT, 0644) = 3
umask(022)                              = 022
fcntl(3, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}
.. which I guess to be trying to do something with locks on the rpm database

I straced a yum operation and got

Code:
open("/var/lib/rpm/.dbenv.lock", O_RDWR|O_CREAT, 0644) = 3
umask(022)                              = 022
fcntl(3, F_SETLKW, {type=F_WRLCK, whence=SEEK_SET, start=0, len=0}
.. not surprisingly, hung in the same place. I don't know if this gets me anywhere. I am fishing
in unknown waters now.

Checked out what was causing the lock, it was dnf. I killed the dnf process, removed dnf from systemctl,
and tried both the rpm and yum operations again. No file locks anymore, but the tracefile on both end
as follows

Code:
mmap(NULL, 286720, PROT_READ|PROT_WRITE, MAP_SHARED, 5, 0) = 0x7f11e1432000
sched_yield()                           = 0
futex(0x7f11e1432334, FUTEX_WAIT, 11, NULL
.. which I understand is an incomplete system call futex(). Something about locking and releasing
shared memory resources?

Quote:
splash splash, it's dark in here!
Steve S

Last edited by steve_s; 07-31-2014 at 03:10 PM. Reason: extra info
 
Old 07-31-2014, 03:03 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,698

Rep: Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582Reputation: 3582
http://elastic-computing.blogspot.co...s-without.html

This may offer clues to fix. As to where updates and installs went on your system I can't say. It may be that all versions are overlapping in some ways.
 
1 members found this post helpful.
Old 07-31-2014, 04:17 PM   #5
steve_s
LQ Newbie
 
Registered: Sep 2007
Posts: 13

Original Poster
Rep: Reputation: 1
Talking

Thanks Jefro. I ran make install on 2.4.6, make altinstall on 2.7.8 amd make altinstall on 3.3.2
The links to executables now are

Code:
python -> python2.4
python2 -> python2.7
python3 -> python3.3
The libraries now are

Code:
/usr/local/lib/python2.4
/usr/local/lib/python2.7
/usr/local/lib/python3.3
Now, this seems like a coherent setup. python/2/3 -V all point to the right versions, but still no yum and no rpm.

Steve S.

.... update ....

Just rebooted & pow! up pops my fairy god-mother, with that "I'll give you three wishes" routine.
Wish number one was easy ...

RPM & YUM both now working

Thanks John VV. Thanks jefro.

Steve S

Last edited by steve_s; 07-31-2014 at 04:31 PM. Reason: extra info
 
  


Reply

Tags
fedora 20, python, rpm, yum


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
I broke my yum by installing Python 2.7 on CentOS jhaprade Red Hat 3 02-02-2013 05:02 AM
Lvm, nfs, raid0&5, linux networking, crontab, yum & rpm packages job description linux_learner12 Linux - Newbie 2 10-02-2012 06:40 AM
Difference of using RPM and YUM in updating packages dwong05 Linux - Newbie 4 04-12-2009 08:19 PM
Updating system with yum broke Openoffice.org Jamo Fedora 3 06-15-2005 04:57 AM
Fedora + yum - rpm-python = :( BrokenBrick Linux - Software 1 03-11-2005 08:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:31 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
Open Source Consulting | Domain Registration