Title: Unable to execute binary file Linux - No such file or directory
Tags: linux;bash
Question: I have an executable launcher-x64-linux, that when invoking ./launcher-x64-linux spits out &quot;bash: ./launcher-x64-linux: No such file or directory&quot;
Invoking file launcher-x64-linux gives me:
launcher-x64-linux: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=4ec13ff8901e49db678f8c4ba00bb6da52ef55b3, stripped
Invoking uname -m spits out x86_64 and readelf launcher-x64-linux | grep interpreter locates the program interpreter at /lib64/ld-linux-x86-64.so.2
and getconf LONGBIT returns 64
So I know it's not a mismatch between 32/64-bit binary and OS
Invoking ldd launcher-x64-linux tells me:
libpthread.so.0
libdl.so.2
libstdc++.so.6
libm.so.6
libgcc_s.so.1
libc.so.6
ld-linux-x86-64.so.2
which I would presume means I'm not missing any libraries
Am I missing something? I'm perplexed as to why I'm told &quot;no such file or directory&quot; exists when I try executing it. Thank you
Comment: `strace -ff -e trace=open,openat sh -c ./launcher-x64-linux` might provide some useful information

Comment: Does `/lib64/ld-linux-x86-64.so.2` exist?

Comment: @Orange Receptacle  can you run it with: sh launcher-x64-linux  ?  can you see it inside function  with: nm -C  launcher-x64-linux  ?

Comment: in  nm -C  launcher-x64-linux   output  , the flags not be 'U"  (undefined)

Comment: @Orange Receptacle The file may be damaged or not compiled properly , Can this Linux run another executable file properly? If yes, have you re-compiled launcher-x64-linux ? Do you have access to the source  launcher-x64-linux?

Comment: @ypnos The `file` output is from the ELF header, and this path needs to exist on the current system. If it doesn't, you get the symptoms OP describes. My Debian system also uses this path.

Comment: @Barmar No, /lib64 is a perfectly normal place on some systems, e.g. Arch Linux.

Comment: Nah, I'm pretty sure the interpreter that `file` gives here is the one on the system that would run the executable file in question.

Comment: @thatotherguy Good point. Explanation here https://greek0.net/elf.html

Comment: I think a more normal place for that would be something like `/usr/lib/lib64`

Comment: @ypnos Hmm, so maybe the executable was compiled for Arch Linux,but they're trying to run it on something else.

Comment: Did you forget `chmod +x ./launcher-x64-linux`?

Comment: I did set chmod to +x before trying other things

Comment: nm -C tells me that there are no symbols, and invoking sh prints out "cannot create 5@@8J@8 ..." along with a bunch of other weird characters



{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 0, 'CommentCount': 14, 'ContentLicense': 'CC BY-SA 4.0', 'CreationDate': '2020:00:11/20/20', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<linux><bash>', 'Title': 'Unable to execute binary file Linux - No such file or directory', 'ViewCount': 955, 'id': 64937934, 'user_AboutMe': '', 'user_AccountId': 4045333.0, 'user_DisplayName': 'Orange Receptacle', 'user_Reputation': 1143.0, 'user_Views': 127.0, 'user_id': 3326720.0}}