Let's say that you've just installed (or removed) some program on your system, and suddenly you get
failed to initialize (something): cannot open shared object file:
no such file or directory
Try this (as root):
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.
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.