LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Tip: handling "cannot open shared object file..." (https://www.linuxquestions.org/questions/linux-newbie-8/tip-handling-cannot-open-shared-object-file-422177/)

sundialsvcs 03-06-2006 11:45 AM

Tip: handling "cannot open shared object file..."
 
Let's say that you've just installed (or removed) some program on your system, and suddenly you get :eek: ...
Code:

failed to initialize (something): cannot open shared object file:
no such file or directory

:eek: !!
Try this (as root):
Code:

# /sbin/ldconfig
There will be a pause, and you're back to the command-prompt without any messages. Try the previous operation again and see if the problem disappeared.

--- Explanation:

Linux supports the concept of "shared libraries" (think "DLL" in Windows), just as Windows does. But Linux's implementation is actually more advanced because it allows you to have more than one version of a shared-library installed at the same time. When a program wants to use a shared-library (as most of them do), the program can be very generic or very specific about what it wants, and Linux will try to comply. Since it would take much too long to search the file-directories for every library request, Linux relies upon a "cache," or reference database, that tells it what libraries are installed, in what version(s), and where. And in this example, that cache is out-of-date, because the library-file is no longer where the cache said it was. The ldconfig program builds or rebuilds that cache.

Many software-installers will execute this command automatically, but some will not. They cannot if you are not installing the software as root, and most (but not all) of them will tell you so. But you can always issue the command yourself.

Dragineez 03-06-2006 12:57 PM

Nice Tip
 
I love it when a question is both asked and answered in the same post. This is something that I'm sure I will desperately need 6 months from now. I'll remember that I once read something about it, but I won't remember what or where! ;)


All times are GMT -5. The time now is 08:15 PM.