Linux – Why Does an Executable Say It Doesn’t Exist When Run?

command linelinuxUbuntu

I have a compiled program, a tagger to identify parts of text, which claims it does not exist.

When I attempt to run it via the command line, I get this:

user@place:/home/user/explicitRedactedPath$ ls tagger
tagger
user@place:/home/user/explicitRedactedPath$ ./tagger arg and other args
-bash: ./tagger: No such file or directory

This executable has to be called by a generated script, which is how I ran into this issue. What are the reasons this error could show up? I'm out of ideas on how to fix it.

Notes:

  • OS is Ubuntu
  • The executable was copied from another machine
  • The file does have execution privileges (it gives a proper not-allowed message without them)
  • I've tried copying the file to a different location (same problem)
  • I've tried replacing the file with a fresh copy (same problem)
  • The file does exist. Opening it with pico shows a file with binary data.

Best Answer

The program was compiled for an incompatible architecture, resulting in a non-executable program. The error message stating "does not exist" instead of "invalid executable" is just a very misleading message.

Recompiling it on the target machine fixed the problem.