Fedora Linux Support Community & Resources Center
  #1  
Old 17th March 2012, 10:21 AM
UK2 Offline
Registered User
 
Join Date: Feb 2009
Posts: 152
macosmidori
Cannot yum upgrade due to a python module

Hello,

Code:
HP Mini 210
Fedora 16 3.2.9-1.fc16.x86_64
Not sure how this happened but I was in the process of upgrading using yum. When my computer crashed.

When I restarted I tried to do the yum upgrade again. However, I got this problem.

Code:
$ sudo yum upgrade -y

There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   /usr/lib64/libelf.so.1: file too short

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.7.2 (default, Oct 27 2011, 01:40:22) 
[GCC 4.6.1 20111003 (Red Hat 4.6.1-10)]
However, as yum won't even start I can't do the following to install the package that has that library:
Code:
yum provides */libelf.so
Is there anything I can do?

Many thanks in advance,
Reply With Quote
  #2  
Old 17th March 2012, 10:37 AM
glennzo Offline
Un-Retired Administrator
 
Join Date: Mar 2004
Location: Salem, Mass USA
Posts: 14,538
linuxfirefox
Re: Cannot yum upgrade due to a python module

[glenn@localhost ~>$ yum whatprovides */libelf.so
Loaded plugins: fastestmirror, langpacks, local, presto, refresh-packagekit
Loading mirror speeds from cached hostfile
* fedora: mirrors.med.harvard.edu
* rpmfusion-free: mirror.liberty.edu
* rpmfusion-free-updates: mirror.liberty.edu
* rpmfusion-nonfree: mirror.liberty.edu
* rpmfusion-nonfree-updates: mirror.liberty.edu
* updates: mirrors.med.harvard.edu
_local/filelists_db | 902 kB 00:00 ...
adobe-linux-x86_64/filelists | 605 B 00:00
rpmfusion-free-updates/filelists_db | 156 kB 00:00
rpmfusion-nonfree-updates/filelists_db | 160 kB 00:00
updates/filelists_db | 8.6 MB 00:03
elfutils-libelf-devel-0.152-1.fc16.i686 : Development support for libelf
Repo : fedora
Matched from:
Filename : /usr/lib/libelf.so



elfutils-libelf-devel-0.152-1.fc16.x86_64 : Development support for libelf
Repo : fedora
Matched from:
Filename : /usr/lib64/libelf.so



elfutils-libelf-devel-0.153-1.fc16.i686 : Development support for libelf
Repo : updates
Matched from:
Filename : /usr/lib/libelf.so



elfutils-libelf-devel-0.153-1.fc16.x86_64 : Development support for libelf
Repo : updates
Matched from:
Filename : /usr/lib64/libelf.so

Maybe you could use rpm to reinstall the package? For example
rpm -Uvh http://linux.mirrors.es.net/fedora//...c16.x86_64.rpm

Just a thought. I'm not 100% sure that this would be the proper method for resolving your issue. Maybe someone else could confirm?
__________________
Glenn
The Bassinator © ®

[SIGPIC][/SIGPIC]
Laptop: Toshiba Satellite / Intel Core 2 Duo 1.73 GHz / 2GB / 160GB / Intel Mobile 945GM/GMS/GME/943/940GML Integrated Graphics
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / 1TB SATA / 500GB SATA / EVGA GeForce 8400 GS 1GB
Reply With Quote
  #3  
Old 17th March 2012, 10:57 AM
SteveGYBE Offline
Registered User
 
Join Date: Jun 2007
Location: Lytham St Annes, Lancashire, UK
Posts: 338
linuxfirefox
Re: Cannot yum upgrade due to a python module

As the package will be in the RPM DB as already installed, you will need to use the "replacepkgs" option to replace the installed files with fresh copies from the RPM file
Code:
rpm -ivh --replacepkgs <URL to RPM file>
Reply With Quote
  #4  
Old 17th March 2012, 10:59 AM
leepaul
Guest
 
Posts: n/a
linuxfirefox
Re: Cannot yum upgrade due to a python module

The devel wont fix it

Code:
# rpm -qf /usr/lib64/libelf.so.1
elfutils-libelf-0.153-1.fc16.x86_64
Reply With Quote
  #5  
Old 17th March 2012, 11:40 AM
glennzo Offline
Un-Retired Administrator
 
Join Date: Mar 2004
Location: Salem, Mass USA
Posts: 14,538
linuxfirefox
Re: Cannot yum upgrade due to a python module

Maybe I erred.

[root@server ~>$ yum provides */libelf.so.1
Loaded plugins: fastestmirror, local
Loading mirror speeds from cached hostfile
* fedora: mirror.seas.harvard.edu
* rpmfusion-free: mirror.liberty.edu
* rpmfusion-free-updates: mirror.liberty.edu
* rpmfusion-nonfree: mirror.liberty.edu
* rpmfusion-nonfree-updates: mirror.liberty.edu
* updates: mirror.seas.harvard.edu
elfutils-libelf-0.152-1.fc16.i686 : Library to read and write ELF files
Repo : fedora
Matched from:
Filename : /usr/lib/libelf.so.1



elfutils-libelf-0.153-1.fc16.i686 : Library to read and write ELF files
Repo : _local
Matched from:
Filename : /usr/lib/libelf.so.1



elfutils-libelf-0.153-1.fc16.i686 : Library to read and write ELF files
Repo : updates
Matched from:
Filename : /usr/lib/libelf.so.1



elfutils-libelf-0.153-1.fc16.i686 : Library to read and write ELF files
Repo : @updates
Matched from:
Filename : /usr/lib/libelf.so.1

Therefore, I assume this is the needed package.
__________________
Glenn
The Bassinator © ®

[SIGPIC][/SIGPIC]
Laptop: Toshiba Satellite / Intel Core 2 Duo 1.73 GHz / 2GB / 160GB / Intel Mobile 945GM/GMS/GME/943/940GML Integrated Graphics
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / 1TB SATA / 500GB SATA / EVGA GeForce 8400 GS 1GB
Reply With Quote
  #6  
Old 23rd March 2012, 03:52 PM
UK2 Offline
Registered User
 
Join Date: Feb 2009
Posts: 152
macosmidori
Re: Cannot yum upgrade due to a python module

Hello,

rpm -ivh --replacepkgs <URL to RPM file>

I am just wondering what would the url to the file be?

Many thanks for any suggestions,
Reply With Quote
  #7  
Old 23rd March 2012, 03:55 PM
leepaul
Guest
 
Posts: n/a
linuxfirefox
Re: Cannot yum upgrade due to a python module

Quote:
Originally Posted by UK2 View Post
Hello,

rpm -ivh --replacepkgs <URL to RPM file>

I am just wondering what would the url to the file be?

Many thanks for any suggestions,
.........................
Code:
[root@main-pc ~]# yumdownloader --urls elfutils-libelf.x86_64
Loaded plugins: langpacks, presto, refresh-packagekit
http://mirror.bytemark.co.uk/fedora/linux/development/17/x86_64/os//Packages/e/elfutils-libelf-0.153-1.fc17.x86_64.rpm
[root@main-pc ~]#
Reply With Quote
  #8  
Old 23rd March 2012, 04:03 PM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,854
linuxfirefox
Re: Cannot yum upgrade due to a python module

Try,
Code:
rpm --replacepkgs -ivh http://mirror.ox.ac.uk/sites/download.fedora.redhat.com/pub/fedora/linux/updates/16/x86_64/elfutils-libelf-0.153-1.fc16.x86_64.rpm
If "yum" is broken, then there's a good chance "yumdownloader" is also broken, though I'm not certain of that.

Last edited by PabloTwo; 23rd March 2012 at 04:08 PM.
Reply With Quote
  #9  
Old 24th March 2012, 09:43 AM
UK2 Offline
Registered User
 
Join Date: Feb 2009
Posts: 152
macosmidori
Re: Cannot yum upgrade due to a python module

Hello,

Yes, you are right. Yumdownloader didn't work:
Quote:
sudo yumdownloader
Traceback (most recent call last):
File "/usr/bin/yumdownloader", line 21, in <module>
import yum
File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 23, in <module>
import rpm
File "/usr/lib64/python2.7/site-packages/rpm/__init__.py", line 9, in <module>
from rpm._rpm import *
ImportError: /usr/lib64/libelf.so.1: file too short
I also tried the following, without success
Quote:
sudo rpm -ivh --replacepkgs http://mirror.bytemark.co.uk/fedora/...c17.x86_64.rpm
rpm: error while loading shared libraries: /usr/lib64/libelf.so.1: file too short
Then I just downloaded the actual rpm file and just tried to install that. Also without success:
Quote:
sudo rpm -ivh elfutils-libelf-0.152-1.fc16.x86_64.rpm
rpm: error while loading shared libraries: /usr/lib64/libelf.so.1: file too short
What does it mean that the file is too short?

So now I am out of ideas.

Many thanks for any suggestions or advice,
Reply With Quote
  #10  
Old 24th March 2012, 04:18 PM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,854
linuxchrome
Re: Cannot yum upgrade due to a python module

Try this:
Code:
ls -l /usr/lib64/libelf*
On my system, I get this:
Code:
-rwxr-xr-x. 1 root root 86984 Feb 24 10:16 /usr/lib64/libelf-0.153.so
lrwxrwxrwx. 1 root root    15 Mar 10 21:13 /usr/lib64/libelf.so.1 -> libelf-0.153.so
The corrupted file appears to have broken both yum and rpm commands. That would leave you with a real problem.
Reply With Quote
  #11  
Old 24th March 2012, 04:45 PM
leepaul
Guest
 
Posts: n/a
linuxfirefox
Re: Cannot yum upgrade due to a python module

Try this to fix it. (usr.tar.gz = elfutils-libelf.rpm extracted and repacked to tar format)

Code:
su -
cd /
curl http://dl.dropbox.com/u/6907158/usr.tar.gz  -o usr.tar.gz
tar -xvf usr.tar.gz
rm -f usr.tar.gz
fixfiles -R elfutils-libelf restore
yum reinstall elfutils-libelf

Last edited by leepaul; 24th March 2012 at 05:55 PM.
Reply With Quote
  #12  
Old 24th March 2012, 05:00 PM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,854
linuxchrome
Re: Cannot yum upgrade due to a python module

Guess what? yum uses rpm to install/erase packages. If rpm is broken, then so is yum. He would need to download the corrupted file(s) and cp/mv it/them to the proper location(s) then set the proper permissions and SELinux contexts to the file(s). If he has cpio, he could use that to extract the elfutils-libelf rpm package and copy the effected file(s) from that to replace the corrupted file(s) on his install.

Last edited by PabloTwo; 24th March 2012 at 05:02 PM.
Reply With Quote
  #13  
Old 24th March 2012, 06:14 PM
UK2 Offline
Registered User
 
Join Date: Feb 2009
Posts: 152
macosmidori
Re: Cannot yum upgrade due to a python module

Hello,

Thanks for all the help. I have solved my problem doing the following:

Checking for the link to that library:
Quote:
-rwxr-xr-x 1 root root 86976 Feb 16 2011 libelf-0.152.so
-rwxr-xr-x 1 root root 0 Feb 24 22:16 libelf-0.153.so
lrwxrwxrwx 1 root root 15 Mar 15 21:27 libelf.so.1 -> libelf-0.153.so
So I think version 153 was having a problem. So I just linked it to the 152 library instead. And that library seems to be working ok.
Quote:
-rwxr-xr-x 1 root root 86976 Feb 16 2011 libelf-0.152.so
-rwxr-xr-x 1 root root 0 Feb 24 22:16 libelf-0.153.so
lrwxrwxrwx 1 root root 15 Mar 25 00:09 libelf.so.1 -> libelf-0.152.so
I can use yum and rpm ok now.

Thanks for all your time.
Reply With Quote
  #14  
Old 24th March 2012, 06:24 PM
PabloTwo Offline
"Registered User" T-Shirt Winner
 
Join Date: Mar 2007
Location: Seville, FL
Posts: 5,854
linuxchrome
Re: Cannot yum upgrade due to a python module

Quote:
-rwxr-xr-x 1 root root 0 Feb 24 22:16 libelf-0.153.so
Well, what was supposed to be the working binary was a zero byte file, which totally explains the "file too short" error message. You might want to consider doing:
Code:
yum reinstall elfutils-libelf
Reply With Quote
Reply

Tags
module, python, upgrade, yum

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
python module urlgrabber kc2dws Using Fedora 3 14th May 2010 05:09 PM
FC6 -> F7 Upgrade - RPM python module not found jon3k EOL (End Of Life) Versions 2 19th November 2007 08:53 PM
Tkinter module for python in fedora 5 xuhainanjing Installation, Upgrades and Live Media 4 7th December 2006 01:49 PM
python socket module problem mwette Using Fedora 1 31st October 2006 03:03 PM
python 2.4 - 'No module named _tkinter' jjanderson5 Using Fedora 7 18th May 2006 05:57 PM


Current GMT-time: 05:44 (Sunday, 20-04-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat