Sunday, August 2, 2015

[Linux] “No such file or directory” on files that exist?

First, this kind of problem is almost related with dynamic loader. You can check out what it is:
To understand Linux Dynamic Loader

After verifying it with several ways:
# file "your binary"
# readelf -l  "your binary"
# strings "your binary" | grep ld-

Then you can find out which dynamic loader your binary uses.
For my case, I just create a symbolic link to my loader, and then it works.
liudanny@Debian7 x64_lsb $ ll /lib64/
total 8
drwxr-xr-x  2 root root 4096 Aug  2 20:49 .
drwxr-xr-x 24 root root 4096 Jun 20 18:14 ..
lrwxrwxrwx  1 root root   32 Feb 22 06:41 -> /lib/x86_64-linux-gnu/
lrwxrwxrwx  1 root root   20 Aug  2 20:49 ->

I also find some other issue about running a 32-bit binary on a 64-bit system. Here is a good answer in the following link:
"But the program is a 32-bit program (as the file output indicates), looking for the 32-bit loader /lib/, and you've presumably only installed the 64-bit loader /lib64/ in the chroot."

To install ia32-libs on debian wheezy amd64:
dpkg --add-architecture i386 
apt-get update
apt-get install libc6:i386
sudo dpkg --add-architecture i386
sudo apt-get update
sudo aptitude install ia32-libs
Post a Comment