I am trying to purge the ldconfig cache of links to libraries to link against. I have a local folder where newly built libraries are placed. I want to update the ldconfig cache to point to these newly built libs.
I have tried using the ldconfig -c command, giving it my own .conf file. I also tried replacing the /etc/ld.so.conf file to point to the new path of libs. But even after doing this, when I check the cache using the ldconfig -p command , it is still showing the old libs.
Hence how to purge and rebuild the ldconfig cache? Just to add : I am on Ubuntu 13.10.
ldconfig creates the necessary links and cache to the most recent shared libraries found in the directories specified on the command line, in the file /etc/ld. so.
so. cache, which contains a compiled list of candidate shared objects previously found in the augmented library path. If, however, the binary was linked with the -z nodeflib linker option, shared objects in the default paths are skipped.
The Linux ldconfig command creates, updates, and removes available symbolic links for currently shared libraries. The symbolic links are based on lib directories in /etc/ld. so. conf. Linux commands rely on shared libraries.
When a program linked with shared libraries runs, program execution does not immediately start with that program's first statement. Instead, the operating system loads and executes the dynamic linker (usually called ld.so), which then scans the list of library names embedded in the executable.
2 years late, but in case someone stumble upon this, as su
(not as sudo
), run the following commands:
rm /etc/ld.so.cache ldconfig
Rebuild cache
Open the /etc/ld.so.conf
as sudo and add a new line with the library directory. In this case, we add /usr/local/lib
. Rerun ldconfig to rebuild the cache:
$ sudo ldconfig
This worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With