Solution to a common issue with ELF executables

Are you having difficulty executing a file on 64 bit Linux because the executable crashes yelling it cannot find itself?

$ ls
cat.jpg executable* secret.txt
$ ./executable -argument param -argument2  param
./executable: file not found

This is not an existential issue of your filesystem, instead your system is missing the correct libc for the architecture of the software you are trying to execute.
You can verify it by executing:

$ file ./executable
exeutable: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.24, BuildID[sha1]=11e741041c519dd5aee726c7170d345a6abf542c, not stripped

Modern, standard 64 bits executables will have a binary interpreter under /lib64 (eg. /lib64/ld-linux-x86-64.so.2) and not /lib (eg. /lib/ld-linux.so.2); in addition, the file utility reports explicitly the architecture at the beginning of the output line.
Now you are sure the executable which cannot find itself requires another ELF interpreter!

SOLUTION: install libc6-i386 using apt and the issue will disappear instantly!


#Debian #Android #Linux #androidstudio #sysadmin #system #tip

There are no comments yet.