Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

Tags:

yum

glibc

When I exectued command to install application following error accured: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

I was not aware of how to fix this problem, to find out resolution I searched for solotutions on net and found following resolution:

yum install glibc.i686 or yum install glibc.i386

But bad luck this was not worked at all. It was throwing the following error:

Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Setting up Install Process
No package glibc.i686 available.
Error: Nothing to do

Again I tried to resolve this and got some solutions from net;

Download glibc rpm packge for centos 6 and install them.

I dowloaded following packeges:

glibc-2.12-1.80.el6.i686.rpm
glibc-common-2.12-1.80.el6.i686.rpm
glibc-devel-2.12-1.80.el6.i686.rpm
glibc-headers-2.12-1.80.el6.i686.rpm
glibc-static-2.12-1.80.el6.i686.rpm
glibc-utils-2.12-1.80.el6.i686.rpm

And tried to install with following command:

yum install glibc.i686
rpm -U glibc-2.12-1.80.el6.i686.rpm
rpm -ivh glibc-2.12-1.80.el6.i686.rpm

None of them is worked. Got following message:

[root@demo tmp_glibc]# rpm -ivh glibc-2.12-1.80.el6.i686.rpm
    error: Failed dependencies:
    glibc-common = 2.12-1.80.el6 is needed by glibc-2.12-1.80.el6.i686
    libfreebl3.so is needed by glibc-2.12-1.80.el6.i686
    libfreebl3.so(NSSRAWHASH_3.12.3) is needed by glibc-2.12-1.80.el6.i686

To resolve dependency problem tried to install "glibc-common-2.12-1.80.el6.i686.rpm", but again bad luck runs and gives error:

[root@demo tmp_glibc]# rpm -ivh glibc-common-2.12-1.80.el6.i686.rpm
error: Failed dependencies:
    glibc = 2.12-1.80.el6 is needed by glibc-common-2.12-1.80.el6.i686
    libc.so.6 is needed by glibc-common-2.12-1.80.el6.i686
    libc.so.6(GLIBC_2.0) is needed by glibc-common-2.12-1.80.el6.i686
    libc.so.6(GLIBC_2.1) is needed by glibc-common-2.12-1.80.el6.i686
    libc.so.6(GLIBC_2.1.1) is needed by glibc-common-2.12-1.80.el6.i686
    libc.so.6(GLIBC_2.1.3) is needed by glibc-common-2.12-1.80.el6.i686
    libc.so.6(GLIBC_2.10) is needed by glibc-common-2.12-1.80.el6.i686
    libc.so.6(GLIBC_2.2) is needed by glibc-common-2.12-1.80.el6.i686
    libc.so.6(GLIBC_2.3) is needed by glibc-common-2.12-1.80.el6.i686
    libcap.so.2 is needed by glibc-common-2.12-1.80.el6.i686
    libdl.so.2 is needed by glibc-common-2.12-1.80.el6.i686
    libdl.so.2(GLIBC_2.0) is needed by glibc-common-2.12-1.80.el6.i686
    libdl.so.2(GLIBC_2.1) is needed by glibc-common-2.12-1.80.el6.i686

Can anyone please help me figure out how to resolve this?

More Details: Operating System: centos 6.3 Yum installed packege list:

[root@demo tmp_glibc]# yum list installed glibc
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Installed Packages
glibc.x86_64   
like image 742
vijay Avatar asked Dec 25 '12 11:12

vijay


People also ask

How do I fix Lib Ld Linux SO 2 bad ELF interpreter No such file or directory?

2: bad ELF interpreter: No such file or directory. To solve this problem you should install glibc. i686 packages.

What is bad ELF interpreter?

The cause of the “bad ELF interpreter” error is usually because the operating system doesn't have the support libraries to run 32-bit applications, so we need to install them.

What is Lib Ld Linux so?

/lib/ld.so a.out dynamic linker/loader /lib/ld-linux.so.{1,2} ELF dynamic linker/loader /etc/ld.so.cache. File containing a compiled list of directories in which to search for libraries and an ordered list of candidate libraries.

What is Ld Linux SO 2?

This program is defined as part of the structure of the ELF file, in the INTERP section of the program header. For 32bit linux binaries, this is the typical name of the 32bit interpreter. For 64bit binaries, you'll find it is typically called ld-linux-x86_64. so. 2 (for 64bit x86 platforms).


4 Answers

yum install glibc.i686

install this.

like image 95
borayeris Avatar answered Oct 16 '22 16:10

borayeris


You did not mention what the command was that you were trying to run that produced the error message. However, the bottom line problem is that you are trying to run and/or install 32-bit (i686) packages on a 64-bit (x86_64) system which is not a good idea. For example, if you were trying to run the 32-bit version of Perl on a 64-bit system, the result would be something like

perl: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

If you still want to use the rpm command to install the 32-bit versions of glibc and glibc-common on your system, then you need to know that you must install both of the packages at the same time and as a single command because they are dependencies of each other. The command to run in your case would be:

rpm -Uvh glibc-2.12-1.80.el6.i686.rpm glibc-common-2.12-1.80.el6.i686.rpm

like image 26
ZaSter Avatar answered Oct 16 '22 16:10

ZaSter


Missing prerequisites. IBM has the solution below:

yum install gtk2.i686
yum install libXtst.i686

If you received the the missing libstdc++ message above, 
install the libstdc++ library: 
yum install compat-libstdc++

https://www-304.ibm.com/support/docview.wss?uid=swg21459143
like image 9
GabrielB Avatar answered Oct 16 '22 17:10

GabrielB


As @borayeris said,

yum install glibc.i686

But if you cannot find glibc.i686 or libstdc++ package, try -

sudo yum search glibc
sudo yum search libstd

and then,

sudo yum install {package}

like image 5
Vipul Sharma Avatar answered Oct 16 '22 16:10

Vipul Sharma