A binary file exists but shell says no such file

  1. I’m using the Ubuntu in UserLAnd on an android.
  2. I just installed from the Android SDK Manager sdkmanager cmake 3.18.1.

Now, I can see the cmake executable from its directory cmake/3.18.1/bin byls, but when I run ./cmake, bash returns bash: ./cmake: No such file or directory. What went wrong? The full output from console:

ubuntu@me:~/cmake/3.18.1/bin$ ls
ccmake  cmake  cpack  ctest  ninja

ubuntu@me:~/cmake/3.18.1/bin$ ./cmake
bash: ./cmake: No such file or directory

ubuntu@me:~/cmake/3.18.1/bin$ file ./cmake
./cmake: 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.24, stripped

ubuntu@me:~/cmake/3.18.1/bin$ ldd ./cmake
        not a dynamic executable

ubuntu@me:~/cmake/3.18.1/bin$ uname -m              
        aarch64

Thanks!

Asked By: wicstas

||

This confusing error, no file found, is what you get if you try to run a binary compiled for a different architecture. In your case, you are running on an AArch64 system, on an ARM chip. However, your binary was compiled for x86-64, an architecture used in Intel and AMD chips (possibly others too).

In short, you cannot execute this binary on your system. Instead, you need to download a version compiled for AArch64 or compile it yourself from source.

Answered By: terdon
Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.