LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   "error while loading shared libraries" "No such file or directory" (https://www.linuxquestions.org/questions/linux-software-2/error-while-loading-shared-libraries-no-such-file-or-directory-4175717461/)

Mike Davies 10-05-2022 01:16 PM

"error while loading shared libraries" "No such file or directory"
 
I have for the first time installed a Ubuntu system. I downloaded the image off the Ubuntu site and installed it OK.

Everything seemed to work OK until I tried the "man" command. then I get
Code:

mike@ubuntu:~$ man ping
man: error while loading shared libraries: libmandb-2.10.2.so: cannot open shared object file: No such file or directory

For a start, the file exists, and it seems to have the same sort of file protections as my other linux system, and it's in the same sort of place.

Code:

mike@ubuntu:~$ ls -al /usr/lib/man-db/libmandb-2.10.2.so
-rw-r--r-- 1 root root 22448 Mar 17  2022 /usr/lib/man-db/libmandb-2.10.2.so
mike@ubuntu:~$

Reading up this people suggest LD_LIBRARY_PATH, but that seems OK too

Code:

mike@ubuntu:~$ echo $LD_LIBRARY_PATH
/usr/lib:/lib:/usr/local/lib:/usr/lib/man-db

I stuck /usr/lib/man-db on the end in the vain hope it would work, but it didn't.

Has anyone got any ideas what is going on ? Pretty much everything else seems to work.

Ser Olmy 10-05-2022 01:33 PM

Is this a 32-bit or a 64-bit system?

What do file $(which man) and ldd $(which man) have to say about the man executable?

Emerson 10-05-2022 01:42 PM

Perhaps one run of ldconfig will fix it.

Mike Davies 10-06-2022 06:09 AM

Tried running ldconfig and setting the cache, but it didn't help.

mike@ubuntu:~$ file $(which man)
/usr/bin/man: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, BuildID[sha1]=9d1d6afa5c4cd04bcba60554a3ece9c7e9c4c03d, for GNU/Linux 3.7.0, stripped
mike@ubuntu:~$ ldd $(which man)
linux-vdso.so.1 (0x0000ffffa0eff000)
libmandb-2.10.2.so => /usr/lib/man-db/libmandb-2.10.2.so (0x0000ffffa0d70000)
libman-2.10.2.so => /usr/lib/man-db/libman-2.10.2.so (0x0000ffffa0d30000)
libz.so.1 => /lib/aarch64-linux-gnu/libz.so.1 (0x0000ffffa0d00000)
libpipeline.so.1 => /lib/aarch64-linux-gnu/libpipeline.so.1 (0x0000ffffa0ce0000)
libc.so.6 => /lib/aarch64-linux-gnu/libc.so.6 (0x0000ffffa0b30000)
/lib/ld-linux-aarch64.so.1 (0x0000ffffa0ec6000)
libgdbm.so.6 => /lib/aarch64-linux-gnu/libgdbm.so.6 (0x0000ffffa0b10000)
libseccomp.so.2 => /lib/aarch64-linux-gnu/libseccomp.so.2 (0x0000ffffa0ae0000)
mike@ubuntu:~$ ls -al /bin/man
-rwxr-xr-x 1 root root 116144 Mar 17 2022 /bin/man

pan64 10-06-2022 06:15 AM

and what about: file /usr/lib/man-db/libmandb-2.10.2.so

Mike Davies 10-06-2022 06:29 AM

mike@ubuntu:~$ ls -al /usr/lib/man-db/libmandb-2.10.2.so
-rwxr-xr-x 1 root root 22448 Mar 17 2022 /usr/lib/man-db/libmandb-2.10.2.so
mike@ubuntu:~$

Not sure if it needs to be marked executable or not. I suspect not.

But ldd finds it so why is it saying it doesn't exist.

It has to be something obvious, but I cant see it, and other the "man" cammand everything seems to be working OK.

Emerson 10-06-2022 06:33 AM

file, not ls.

Mike Davies 10-06-2022 06:35 AM

mike@ubuntu:~$ file /usr/lib/man-db/libmandb-2.10.2.so
/usr/lib/man-db/libmandb-2.10.2.so: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, BuildID[sha1]=f3c95f5ff40f6101b1c4840af73c7621edf01c76, stripped

pan64 10-06-2022 08:20 AM

ok, it is quite strange. In such cases I would suggest you to run:
Code:

strace -o /tmp/strace.log man ping
and grep libmandb in that /tmp/strace.log

Mike Davies 10-06-2022 09:13 AM

Oh, err. It's coming up permission denied. So it knows it is there. Now just got to work out why it's permission denied.

mike@ubuntu:~$ cat /tmp/strace.log | grep libmandb
openat(AT_FDCWD, "/usr/lib/tls/aarch64/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/tls/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/aarch64/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/lib/tls/aarch64/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/tls/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/aarch64/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/usr/local/lib/tls/aarch64/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/lib/tls/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/lib/aarch64/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/local/lib/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/usr/lib/man-db/tls/aarch64/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/man-db/tls/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/man-db/aarch64/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/man-db/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/usr/lib/man-db/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/lib/aarch64-linux-gnu/tls/aarch64/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/aarch64-linux-gnu/tls/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/aarch64-linux-gnu/aarch64/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/aarch64-linux-gnu/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/tls/aarch64/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/tls/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/aarch64/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/usr/lib/aarch64-linux-gnu/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/lib/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/usr/lib/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
writev(2, [{iov_base="man", iov_len=3}, {iov_base=": ", iov_len=2}, {iov_base="error while loading shared libra"..., iov_len=36}, {iov_base=": ", iov_len=2}, {iov_base="libmandb-2.10.2.so", iov_len=18}, {iov_base=": ", iov_len=2}, {iov_base="cannot open shared object file", iov_len=30}, {iov_base=": ", iov_len=2}, {iov_base="Permission denied", iov_len=17}, {iov_base="\n", iov_len=1}], 10) = 113
mike@ubuntu:~$

"sudo man ping" works. So it really is a permissions thing.

So apart from Owner, Group, Other. What other permissions are there on Ubuntu ? Does it use ACL and selinux ? I tried getfacl and it's not installed, so I guess ACLs are not used on this Ubuntu system.

pan64 10-06-2022 09:27 AM

probably you need to set execute permission on that lib

Mike Davies 10-06-2022 09:35 AM

No. Makes no difference.

Code:

mike@ubuntu:~$ ls -al /usr/lib/man-db
total 220
drwxr-xr-x  2 root root  4096 Oct  6 13:01 .
drwxr-xr-x 83 root root  4096 Oct  6 11:13 ..
-rwxr-xr-x  1 root root 184496 Mar 17  2022 libman-2.10.2.so
lrwxrwxrwx  1 root root    16 Mar 17  2022 libman.so -> libman-2.10.2.so
-rwxr-xr-x  1 root root  22448 Mar 17  2022 libmandb-2.10.2.so
lrwxrwxrwx  1 root root    18 Mar 17  2022 libmandb.so -> libmandb-2.10.2.so
lrwxrwxrwx  1 root root    13 Mar 17  2022 man -> ../../bin/man
lrwxrwxrwx  1 root root    15 Mar 17  2022 mandb -> ../../bin/mandb
mike@ubuntu:~$ man ping
man: error while loading shared libraries: libmandb-2.10.2.so: cannot open shared object file: No such file or directory
mike@ubuntu:~$


Emerson 10-06-2022 09:47 AM

This may sound crazy, but does this system have man group?

pan64 10-06-2022 09:51 AM

No, something is not ok here:
Quote:

openat(AT_FDCWD, "/lib/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/usr/lib/libmandb-2.10.2.so", O_RDONLY|O_CLOEXEC) = -1 EACCES (Permission denied)
These are located in /lib and /usr/lib. And probably they really not accessible, but available. You need to check the permission on those files, not inside /usr/lib/man-db.

Mike Davies 10-06-2022 09:53 AM

It does. I added my user to the man group. Logged out and back in. Made no difference.


All times are GMT -5. The time now is 08:11 AM.