Cannot run 32-bit executable on 64-bit system with multi-arch support
“No such file or directory” for a file that exists is a symptom of a missing loader. In your case, with a 32-bit binary on a 64-bit system, you're missing the dynamic loader /lib/ld-linux.so.2
.
Having multi-arch enabled means that you can install 32-bit packages on your 64-bit system. But to actually run 32-bit executables, you need to actually install 32-bit packages. At the very least, install libc6:i386; this is the package that contains the dynamic loader. Once you do that, you may still get errors refering to missing libraries, so install the requisite 32-bit library packages (libFOO:i386
).
Related videos on Youtube
Comments
-
Sriram over 1 year
I compiled a 32-bit executable for a Linux machine. It runs on most Linux distros without trouble. However, on Ubuntu 16.04 LTS, I get the
No such file or directory
error when trying to execute it. The executable is present in the directory and has all the relevant permissions set.There are a few answers detailing a solution to this (like here). So, I did:
1.dpkg --print-architecture
printsamd64
.
2.dpkg --print-foreign-architecture
printsi386
.
Even with multi-arch enabled by default, I am unable to get the executable to work.What else do I need to install/do in order to get this executable to work?
P.S: The system does not have ia32-libs installed.
-
Alessio about 8 yearsdid you try running
ldd /path/to/your/32-bit/binary
? your ubuntu 16.04 system is probably missing the 32-bit libraries that your program needs. BTW, ia32-libs is obsolete, long replaced by multi-arch and simply installing the 32-bit versions of the libraries alongside the 64-bit version (e.g.apt-get install libc6:i386
) -
Alessio about 8 yearsalso, why not just recompile your program for amd64? and make a
.deb
package while you're at it. -
Rui F Ribeiro about 8 yearsYou may create a multiarch deb. askubuntu.com/questions/396030/how-do-i-create-a-multiarch-deb
-
Sriram about 8 years@cas: Running
ldd pathToBinary
returns "not a dynamic executable". I could compile it against a 64-bit install too, but then it would require a lot more testing etc. and timelines are already very short. A multi-arch .deb package for a single executable? I might need to investigate that.. -
Sriram about 8 yearsAlso, internet access on the target systems cannot be presumed. If I install the .deb file, that means it will take the dependencies off the internet right?
-
Stephen Kitt about 8 yearsWhat does
file pathToBinary
say?
-