LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   passwd: error while loading shared libraries: libdl.so.2 (https://www.linuxquestions.org/questions/linux-software-2/passwd-error-while-loading-shared-libraries-libdl-so-2-a-4175500403/)

velociraptor 04-03-2014 01:10 AM

passwd: error while loading shared libraries: libdl.so.2
 
I am using Red Hat Enterprise Linux Server Release 6.4 (Santiago).

I have a problem with the 'passwd' command. Everytime I call this command (in the root account), I get the following message:

passwd: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory.

I wonder how to fix the problem. Thanks.

If it helps, I also include the following:

Code:

[root@server1 production]# ldd /bin/passwd
        linux-vdso.so.1 =>  (0x00007fff18e8c000)
        libuser.so.1 => /usr/lib64/libuser.so.1 (0x0000003d15a00000)
        libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007f2c925c8000)
        libgobject-2.0.so.0 => /lib64/libgobject-2.0.so.0 (0x0000003966a00000)
        libgmodule-2.0.so.0 => /lib64/libgmodule-2.0.so.0 (0x0000003966e00000)
        libglib-2.0.so.0 => /lib64/libglib-2.0.so.0 (0x0000003964600000)
        libpopt.so.0 => /lib64/libpopt.so.0 (0x0000003d1f600000)
        libpam_misc.so.0 => /lib64/libpam_misc.so.0 (0x0000003d16600000)
        libaudit.so.1 => /lib64/libaudit.so.1 (0x0000003d21200000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x0000003966200000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f2c92231000)
        libpam.so.0 => /lib64/libpam.so.0 (0x0000003d1fe00000)
        libfreebl3.so => /lib64/libfreebl3.so (0x00007f2c91fb9000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007f2c91db5000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f2c9281a000)

[root@server1 production]# ls -l /lib64/libdl.so.2
-rw-r--r--. 1 root root 19536 Apr  3 12:43 /lib64/libdl.so.2

[root@server1 production]# ldd -v /lib64/libdl.so.2
ldd: warning: you do not have execution permission for `/lib64/libdl.so.2'
        linux-vdso.so.1 =>  (0x00007fff05d9b000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f299220b000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f29927a4000)

        Version information:
        /lib64/libdl.so.2:
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
                libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
        /lib64/libc.so.6:
                ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
                ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2


colucix 04-03-2014 01:32 AM

Code:

ldd: warning: you do not have execution permission for `/lib64/libdl.so.2'
This could be the issue. On my system (CentOS 6.5) I have
Code:

$ ls -l /lib64/libdl.so.2 /lib64/libdl-2.12.so
-rwxr-xr-x. 1 root root 22536 Nov 21 22:38 /lib64/libdl-2.12.so
lrwxrwxrwx. 1 root root    13 Jan 13 16:41 /lib64/libdl.so.2 -> libdl-2.12.so

I would check also the integrity of the package in question (glibc), in order to understand if the problem is more extended. You should also investigate why permissions changed.

velociraptor 04-03-2014 08:57 PM

Actually it's a long story before this problem exists. What I remember is: initially, due to some other problems, I was not able to run any of the unix command (i.e. ls, cd, rpm). The terminal kept giving me similar error message (error while loading shared libraries: libdl.so.2) every time I keyed in any unix command.

In order to solve this, I downloaded an rpm package (http://mirror.centos.org/centos/6/os...el6.x86_64.rpm) using another linux machine and opened the package using rpm2cpio command. Here I downloaded centos package since I think it may work on RHEL. Afterwards, I copied the libdl-2.12.so file from the package to the problematic machine. Somehow, it solves the problem partially. I am able to run most of the unix commands so far, except passwd.

This morning, I tried to install the rpm using the same glibc rpm package directly using the rpm command. Now, everytime I execute ldd -v /lib64/libdl.so.2 command, I no longer get the "ldd: warning: you do not have execution permission for `/lib64/libdl.so.2'" message. However, I am still not able to execute passwd command.

Really appreciate your help.

The following are the codes in details:

[root@server1 CENTOS]# ldd -v /lib64/libdl.so.2
linux-vdso.so.1 => (0x00007fffb63ff000)
libc.so.6 => /lib64/libc.so.6 (0x00007fcc42f0e000)
/lib64/ld-linux-x86-64.so.2 (0x00007fcc434a7000)

Version information:
/lib64/libdl.so.2:
ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
libc.so.6 (GLIBC_PRIVATE) => /lib64/libc.so.6
libc.so.6 (GLIBC_2.2.5) => /lib64/libc.so.6
/lib64/libc.so.6:
ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2
ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2

[root@server1 CENTOS]# ls -l /lib64/libdl.so.2 /lib64/libdl-2.12.so
--w-r-xr-x. 1 root root 19536 Apr 3 12:43 /lib64/libdl-2.12.so
lrwxrwxrwx. 1 root root 20 Apr 4 09:25 /lib64/libdl.so.2 ->
/lib64/libdl-2.12.so

[root@server1 CENTOS]# passwd
passwd: error while loading shared libraries: libdl.so.2: cannot open
shared object file: No such file or directory

velociraptor 04-04-2014 12:59 AM

The problem has been solved. Apparently, there are some folders in the system whose names were changed earlier. Thanks for your help anyway.


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