Binary not found

Robert Heller heller at deepsoft.com
Wed May 26 18:08:41 UTC 2021


At Wed, 26 May 2021 17:46:13 +0100 "Ubuntu user technical support,? not for general discussions" <ubuntu-users at lists.ubuntu.com> wrote:

> 
> I have a copy of the commercial P-Stat statistics package in
> /usr/local/share/pstat:
> 
> $ cd /usr/local/share/pstat/
> $ ls -l
> total 8716
> drwxrwxr-x 2 peter peter   12288 Feb 25 19:52 helpfiles
> -rwxrwxr-x 1 peter peter 7966976 Feb 25 19:52 p-stat
> -rw-rw-r-- 1 peter peter  783052 Feb 25 19:52 pstat.help
> -rwxrwxr-x 1 peter peter       7 Feb 25 19:52 pstatlp
> -rw-rw-r-- 1 peter peter  113919 Feb 25 19:52 pstat.out
> -rw-rw-r-- 1 peter peter   34865 Feb 25 19:52 pstat.test
> $
> 
> (Yes, the binary *does* have a hyphen, to avoid confusion with the old
> system utility called pstat.)
> 
> But when I try to execute it, I get a weird error message
> 
> $ ./p-stat
> bash: ./p-stat: No such file or directory
> $
> 
> which is obviously nonsense. The same happens if I execute the shell
> script in my ~/bin directory (which implements my license key).
> 
> Does anyone know why the system is pretending that the file does not
> exist which it clearly does?
> 
> It's not something obvious, like the filename containing a space or
> other bogus character. The directory listing is correct, and a
> comparison with the installation zip file shows the binary is the right
> size.
> 
> I've been using the package for decades, and it has worked on every
> system I have installed it on (and still does, on other hosts).

Typically this is because it is missing some "helper" file, often a script
interpreter (is that a script or an ELF file -- the file command is your
friend). The other possiblity is it is a 32-bit application and you don't have
the 32-bit support infrastructure installed. Again the file command is your 
friend, as is ldd.  My guess is that this stat package is a i386 binary and you copied it to a 
system that does not have libc:i386 installed and the file that is not found 
is /lib/ld-linux.so.2. 

One other option: you have either missing or wrong versioned shared library.

For example here is what file and ldd return for i386 and x86_64 binaries:

sauron% file /usr/local/share/tclkits/tclkit-8.6.11-{i386,x86_64}
/usr/local/share/tclkits/tclkit-8.6.11-i386:   ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=65aa445c7951217544798409650d6bde507444c9, stripped
/usr/local/share/tclkits/tclkit-8.6.11-x86_64: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=e1f3355194e78cd19308d6a1fb5fc4c6f519bb1a, stripped
sauron% ldd /usr/local/share/tclkits/tclkit-8.6.11-{i386,x86_64}
/usr/local/share/tclkits/tclkit-8.6.11-i386:
        linux-gate.so.1 (0xf7f18000)
        libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7cf6000)
        libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0xf7cd7000)
        libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0xf7cb7000)
        libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf7bb5000)
        libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf79d9000)
        /lib/ld-linux.so.2 (0xf7f1a000)
/usr/local/share/tclkits/tclkit-8.6.11-x86_64:
        linux-vdso.so.1 (0x00007ffe7e9d6000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f98562f9000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f98560dc000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f9855ebd000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f9855b1f000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f985572e000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f98568c2000)

Whenever I get this sort of error message that (like in your case) appears to
make no sense, I use file and/or ldd to check the binary and discover its
*real* problem. The file and/or ldd commands usually point me to what I need
to do (eg install missing libraries or script interpreters, etc.).


> 
> Peter
> 

-- 
Robert Heller             -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software        -- Custom Software Services
http://www.deepsoft.com/  -- Linux Administration Services
heller at deepsoft.com       -- Webhosting Services
                                                           




More information about the ubuntu-users mailing list