wget: libc.so.6: invalid ELF header

General support questions including new installations
Post Reply
dreville
Posts: 3
Joined: 2012/10/04 15:16:03

wget: libc.so.6: invalid ELF header

Post by dreville » 2012/10/04 15:28:45

Hi everyone,

I have a production server running CentOS release 5.8 (Final). No development occurs on this server. It's only for hosting some scientific web tools. It just gets the Centos yum updates when available.

I recently ran into an issue. I was trying to use wget to download some files and I ran into this error:

[code]wget: error while loading shared libraries: /usr/lib64/libc.so.6: invalid ELF header[/code]

I'm having a hard time figuring out what could be the cause of this error. glibc and all related packages are all up-to-date.

Has anybody run into this error before? Any help would be greatly appreciated.

Thank you!

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

wget: libc.so.6: invalid ELF header

Post by TrevorH » 2012/10/04 15:57:01

You sure it was /usr/lib64/libc.so.6? The CentOS supplied copies of this file should be in /lib/libc.so.6 and /lib64/libc.so.6 not in /usr/lib*

You could try

[code]
rpm -qf /usr/lib64/libc.so.6
[/code]

and see what RPM it thinks it belongs to then try an `rpm -V $package` against that package.

dreville
Posts: 3
Joined: 2012/10/04 15:16:03

Re: wget: libc.so.6: invalid ELF header

Post by dreville » 2012/10/04 16:24:30

Thanks for the reply TrevorH!

I just entered the command 'wget' and that was the exact output copied and pasted:

[code]> wget
wget: error while loading shared libraries: /usr/lib64/libc.so.6: invalid ELF header[/code]

I tried your suggestion and it gave me:

[code]> rpm -qf /usr/lib64/libc.so.6
file /usr/lib64/libc.so.6 is not owned by any package[/code]

It seems that you might be right, wget is invoking the wrong library?

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: wget: libc.so.6: invalid ELF header

Post by TrevorH » 2012/10/04 18:17:56

I'd start to get suspicious about now. Nothing in CentOS puts a /usr/lib64/libc.so.6 file in place. You need to find out how it got there and where from and who put it there.

netyale
Posts: 1
Joined: 2013/04/09 22:20:09

Re: wget: libc.so.6: invalid ELF header

Post by netyale » 2013/04/09 22:24:30

I guess I got the same situation.
I'm not sure is it the problem
But I found I have the file libc.so.6 under /lib64/ not under /lib/
I check my system my hard drive format is GPT
I guess I'm in UEFI mode.....maybe

I'm running CentOS 6.4 x64 version

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: wget: libc.so.6: invalid ELF header

Post by TrevorH » 2013/04/09 23:49:49

Please don't hijack other people's threads. While superficially similar, this doesn't seem to be the same thing at all so please start your own thread and post more details about the problem including exact commands you issued and the exact error messages that you see.

The file libc.so.6 should be in /lib64 on CentOS 6 x86_64.

typek_pb
Posts: 1
Joined: 2016/01/11 07:45:07

Re: wget: libc.so.6: invalid ELF header

Post by typek_pb » 2016/01/11 07:47:43

I had similar problem to original one (I'm running RHEL 6.7).
Following did the job for me: https://www.linuxquestions.org/question ... er-529399/

In my case it was simply:

Code: Select all

sudo rm /usr/lib64/libc.so.6 && sudo ln -s /lib/libc.so.6 /usr/lib64/libc.so.6

User avatar
TrevorH
Site Admin
Posts: 33216
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: wget: libc.so.6: invalid ELF header

Post by TrevorH » 2016/01/11 11:38:26

a) Please don't hijack other people's threads
b) you are running RHEL and it's version 6 so doesn't belong in the CentOS 5 forum thread
c) that's pretty much totally the wrong thing to do
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

Post Reply