$ /home/amnesia/myfile
bash: /home/amnesia/myfile: No such file or directory
$ file /home/amnesia/myfile
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared lies), for GNU/Linux 2.6.9, not stripped
So myfile
exists, but running it gives the message “No such file or directory”. This happens in the following circumstance:
- The file depends on a loader — it's a dynamically linked executable, and these need a loader program to load the dynamically linked libraries. (The loader can also be the interpreter designated by a shebang line, but bash detects this case and gives a different error message.)
- The loader file is not present.
The message “No such file or directory” is really about the loader, but the shell doesn't know that the loader is involved, so it reports the name of the original file. I explain this in more detail in “No such file or directory” lies on Optware installed binaries.
Why can't you run this program? Because you don't have the dynamic loader for 64-bit executables.
$ uname -a
Linux amnesia 3.16-3-amd64 #1 SMP Debian 3.16.5-1 (2014-10-10) x86_64 GNU/Linux
$ file /bin/ls
/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0xd3280633faaabf56a14a26693d2f810a32222e51, stripped
Your system has a 64-bit kernel, but the rest of the system is 32-bit. Linux supports this configuration (a 64-bit kernel can run both 64-bit programs and 32-bit programs, but a 32-bit kernel can only run 32-bit programs). The kernel can load the program just fine; you would be able to run a statically-linked amd64 executable. However, you don't have the 64-bit loader (/lib64/ld-linux-x86-64.so.2
), nor presumably any 64-bit library. So you can't run dynamically-linked amd64 executables.
Why would you run a 64-bit kernel with a 32-bit userland?
- To use more than about 3GB of physical memory. (This isn't the only way — another possibility is to run a 32-bit kernel that supports PAE.)
- To be able to run 64-bit binaries, e.g. by booting on the live OS and then chrooting into an installed 64-bit system somewhere.
- To reduce maintenance effort for the distribution: provide a single kernel for recent hardware, and make it 64-bit.
- To run 64-bit virtual machines (some VM engines require a 64-bit kernel to run a 64-bit VM).
I don't think Tails provides a 64-bit system. You should get a 32-bit version of the executable. If you can't, use some other distribution (possibly in a virtual machine).
uname -a
? – Mark Plotnick Nov 08 '14 at 18:41ldd /home/amnesia/myfile
? You may need to install some additional libraries or another runtime linker to allow this older executable to run. Some discussion of this is at http://askubuntu.com/questions/60238/running-a-64bit-executable-on-a-64-ubuntu-lucid ; in that case, adding a symlink fixed the problem. – Mark Plotnick Nov 08 '14 at 20:42sudo
? What is the output ofldd /home/amnesia/myfile
? @JosephR. More precisely, I suspect this issue. – Gilles 'SO- stop being evil' Nov 08 '14 at 22:19ldd/home/amnesia/myfile
is: "not a dynamic executable." What does that mean? – Hodurrr Nov 09 '14 at 16:11file /home/amnesia/myfile
say? – Gilles 'SO- stop being evil' Nov 09 '14 at 18:48file /home/amnesia/myfile
is: 'ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared lies), for GNU/Linux 2.6.9, not stripped' – Hodurrr Nov 09 '14 at 18:50file /bin/ls
? And what's the exact error from running/home/amnesia/myfile
(not as root) (copy-paste!)? – Gilles 'SO- stop being evil' Nov 09 '14 at 18:59file /bin/ls
: "/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.26, BuildID[sha1]=0xd3280633faaabf56a14a26693d2f810a32222e51, stripped" ... Now the output of/home/amnesia/myfile
is "bash: /home/amnesia/myfile: No such file or directory" – Hodurrr Nov 09 '14 at 19:10