Linux Mint: "No such file or directory" -- WTF ??
I've downloaded an executable that I know other people are running under Linux. Typing ./filename gives me the error message "No such file or directory". ls -l clearly show the file is there, belongs to me, and I have permission to read,write, and execute. I get the same error in Lubuntu ! How can a file which is so obviously "there" not be there ??
Recursion
(56,582 posts)What kind of file is it? If it's a script of some sort, it might start out with #!/usr/local/bin/perl whereas your interpreter is /usr/bin/perl (for instance). Or if it's an ELF executable it can mean that a library is missing. What does file(1) say about it?
eppur_se_muova
(37,403 posts)dynamically linked (uses shared libs), for GNU/Linux 2.6.32, .... not stripped
Hope the ... isn't important stuff. I'm running it on another computer, using this one for browser only.
The shared libraries are in a folder whose location I've exported to PATH -- but it's NOT /bin. Is there some chance the libs have to be in a particular place ? (BTW, I'm not getting any help from the users' forum, even though I'm sure someone there knows what I'm talking about.)
Recursion
(56,582 posts)However, you can cheat by using the LD_PRELOAD_PATH variable, eg,
LD_PRELOAD_PATH=/wherever/the/libs/are ./file
Generally a Linux system will look in /usr/local/lib, /usr/lib, and /lib (in that order). Alternately you can just move the shared library to /usr/lib (and then run /sbin/ldconfig /usr/lib).
(Another note: all the appearances of "lib" above may possibly be replaced by "lib64", depending on your distribution.)
eppur_se_muova
(37,403 posts)I had the feeling it was something like this; I had tried editing the PATH variable but that didn't do it.
Recursion
(56,582 posts)eg,
/bin/bash$ LD_PRELOAD_PATH=/home/eppur/downloads/app ./the_program
(In bash and sh,
runs command with variable $NAME set to value, without changing the persistent environment. Note that you don't use $NAME=value but NAME=value.)
(This is from memory but I think LD_PRELOAD_PATH needs to be an absolute path rather than a relative one.)
Once you get it working, you can add that env variable to .profile, or just move the libraries to a trusted directory (and run ldconfig).
As a final thought, you can use ldd(1) to find out what libraries the program needs, and where it thinks those libraries live.
eppur_se_muova
(37,403 posts)apparently it's expecting some files to be in /lib/x86-64-linux-gnu. We'll see if that's it or not, but probably tomorrow. Thanks again!
Recursion
(56,582 posts)If this is from a Debian or Ubuntu package, /lib/x86_64-linux-gnu is where they keep the interpreter that runs C programs (ld-linux.so), and that path is set when a program is compiled. If that file isn't there, a symlink to wherever Mint keeps it should work (I've never used Mint so I don't know its library layout).
Best of luck!
eppur_se_muova
(37,403 posts)eppur_se_muova
(37,403 posts)There is a file called libstdc++.so.6 that I cannot find in /usr/lib/x86_64-linux-gnu/ . A quick check of synaptic package manager fails to find a file by that name -- there are a lot of packages with names beginning with "lib64stdc++" but nothing with .so in the name.
Not sure what to do next.
Recursion
(56,582 posts)Unfortunately, unlike most libraries, libstdc++ will only work with programs compiled with the exact same compiler (and version of that compiler) as libstdc++ was compiled with. So, if you're importing this binary from a different distro (or even a different version of the same distro) you're basically stuck.
This is why C++ is Broken and Wrong, but anyways.
Can you get the source to this program? Your best bet is probably to rebuild it.
eppur_se_muova
(37,403 posts)Yes, I already have the binaries. But I haven't done any compilations outside of an IDE -- and that was Code Warrior for (Classic) Mac, years ago.
There are only a few source files and a Makefile is provided, so I tried running "make" -- got an error message that I don't have nvcc installed, and a quick Google search reveals nvcc as part of the NVidia CUDA tools package -- I already have several versions of that (there are dozens, and you have to get the right one) -- so I'll be doint that installation next. Haven't done that under Linux before, so I'll see how it goes.
Things do seem to be getting closer, though, after *long* last! I'll update results later.
jtuck004
(15,882 posts)than it looks?
Instead of typing the name, (I'm assuming here) can you copy/paste it in after you put your ./ ?
Or the file could be corrupted.