This is an old revision of the document!
Library Paths
General Information
Configuring and viewing OS library paths.
Checklist
- Distro: Enterprise Linux 6/7
Library Config Files
Main Config File: /etc/ld.so.conf includes a directory
include ld.so.conf.d/*.conf
Directory of drop in paths: /etc/ld.so.conf.d/
Example: /etc/ld.so.conf.d/mylibraries.conf
/data/lib/application1/ /data/lib/application2/
Apply Changes: If any changes are made to the above config files, run ldconfig to reload the library cache
ldconfig -v
- -v ⇒ verbose
Library Search Order
Shared libraries needed by programs are searched for in this order:
- Environment variable “LD_LIBRARY_PATH” ⇒ This environmental variable can be set like any other environment variable. (shell, .bashrc, .profile)
- (ELF binaries only) ⇒ Directories specified within the binary. (DT_RUNPATH)
- From cache file (/etc/ld.so.cache) ⇒ created via ldconfig
- In default system library paths (/lib, /usr/lib)