LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Shared library error (http://www.linuxquestions.org/questions/linux-newbie-8/shared-library-error-696058/)

an_sush 01-09-2009 05:14 AM

Shared library error
 
I have a linux box and i connect to it using putty on my windows. But when i login as root i get the follwing error:
/bin/sh: error while loading shared libraries: libdl.so.2: cannot open shared object file: No such file or directory
and no other command like echo, ls works.

However if i login as a non root user and then do a su, i dont get any such error and all commands work properly.
Kindly help

chakka.lokesh 01-09-2009 05:18 AM

check the following link:

http://linux.derkeiler.com/Mailing-L.../msg01399.html

and tell me does this helped you?

repo 01-09-2009 05:20 AM

try to run
ldconfig

an_sush 01-09-2009 05:41 AM

Quote:

Originally Posted by chakka.lokesh (Post 3402185)
check the following link:

http://linux.derkeiler.com/Mailing-L.../msg01399.html

and tell me does this helped you?

no solution in the above post


ldconfig also doesnt work:

Quote:

sh-3.2# ldconfig
sh: ldconfig: command not found

chakka.lokesh 01-09-2009 05:45 AM

Quote:

Originally Posted by an_sush (Post 3402204)
no solution in the above post

try installing this.

http://cvs.sourceforge.jp/cgi-bin/vi...bc/ldso/libdl/

an_sush 01-09-2009 05:53 AM

Quote:

Originally Posted by chakka.lokesh (Post 3402207)

wat to install here? a header file and 2 c files?

chakka.lokesh 01-09-2009 07:38 AM

Can you tell me which Linux distribution you are using?

sundialsvcs 01-09-2009 09:26 AM

First of all, the command probably needs to be: /sbin/ldconfig.

Next, you need to locate libdl.so to see if the file actually exists at all on your system. On my system, it's found in /lib, and if "locate" does not produce an answer do ls /lib/*libdl* and ls /usr/lib/*libdl* just to be make sure. (The "locate" command uses a database that could be out-of-date.)

The loader system in Linux is very flexible, and unlike Windows it does not specify that libraries must be in one certain place nor that only a single version of a library can be installed at one time. (Hence "ldconfig," which builds or rebuilds a search-directory.)

Your immediate concern, though, is not to understand how it works but merely to understand why it is broken. (You can "think about" the fire at your leisure after you have put it out...)

If you find that the library really isn't there, you need to find out which package(s) contain it and to reinstall those packages. (Hopefully the package-installation software does not require this library.) But the first thing to rule-out is that "it's really there, but the ldconfig-index is not up-to-date and therefore does not see it."

This problem could be very tough to fix if the so-called "busybox" core software is affected... commands like ls and so-on. Your hands might be well-tied. And if that is the case, and you can't come up with an immediate :rolleyes: explanation of how it happened, uhh... you might have been hacked or root-kitted. But for right-now, let us hope for the best.


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