Welcome to DU! The truly grassroots left-of-center political community where regular people, not algorithms, drive the discussions and set the standards. Join the community: Create a free account Support DU (and get rid of ads!): Become a Star Member Latest Breaking News General Discussion The DU Lounge All Forums Issue Forums Culture Forums Alliance Forums Region Forums Support Forums Help & Search

eppur_se_muova

(36,287 posts)
Sun Jul 12, 2015, 11:56 PM Jul 2015

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 ??

12 replies = new reply since forum marked as read
Highlight: NoneDon't highlight anything 5 newestHighlight 5 most recent replies

Recursion

(56,582 posts)
1. That can mean a missing library or interpreter
Sun Jul 12, 2015, 11:57 PM
Jul 2015

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

(36,287 posts)
2. ELF 64-bit LSB executable, x86-64, version 1 (SYSV), ...
Mon Jul 13, 2015, 12:04 AM
Jul 2015

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)
3. The libs need to be in a certain directory
Mon Jul 13, 2015, 12:08 AM
Jul 2015

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

(36,287 posts)
4. Thanks, this goes in .profile ??
Mon Jul 13, 2015, 12:15 AM
Jul 2015

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)
5. You could do that, but for starters just type it when you run the program
Mon Jul 13, 2015, 12:17 AM
Jul 2015

eg,

/bin/bash$ LD_PRELOAD_PATH=/home/eppur/downloads/app ./the_program


(In bash and sh,

NAME=value command


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

(36,287 posts)
6. Thanks a brazillion ! Haven't got it to work yet, but ldd may have given me the answer ...
Mon Jul 13, 2015, 01:31 AM
Jul 2015

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)
7. Sure thing! Quick note: it's probably /lib/x86_64-linux-gnu, not x86-64
Mon Jul 13, 2015, 01:34 AM
Jul 2015

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

(36,287 posts)
10. ldd may have found the problem ...
Mon Jul 13, 2015, 01:13 PM
Jul 2015

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)
11. libstdc++ is part of your compiler toolchain, and I have bad news
Tue Jul 14, 2015, 07:05 AM
Jul 2015

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

(36,287 posts)
12. I'll pass that news on to the people distributing the binaries.
Tue Jul 14, 2015, 10:19 AM
Jul 2015

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)
9. I wonder if the file name might have a letter in it that is somewhat different
Mon Jul 13, 2015, 07:50 AM
Jul 2015

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.

Latest Discussions»Culture Forums»Open Source and Free Software»Linux Mint: "No such...