linux_wiki:library_paths

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

linux_wiki:library_paths [2018/06/19 16:16]
billdozor [Override Search Order]
linux_wiki:library_paths [2019/05/25 23:50]
Line 1: Line 1:
-====== Library Paths ====== 
- 
-**General Information** 
- 
-Configuring and viewing OS library paths.  
- 
-**Checklist** 
-  * Distro(s): Enterprise Linux 6/7 
- 
----- 
- 
-====== Library Config Files ====== 
- 
-**Main Config File**: /etc/ld.so.conf includes a directory 
-<code bash> 
-include ld.so.conf.d/*.conf 
-</code> 
- 
-\\ 
-**Directory of drop in paths**: /etc/ld.so.conf.d/ 
-\\ 
-Example: /etc/ld.so.conf.d/mylibraries.conf 
-<code bash> 
-/data/lib/application1/ 
-/data/lib/application2/ 
-</code> 
- 
-\\ 
-Apply Changes: If any changes are made to the above config files, run ldconfig to reload the library cache 
-<code bash> 
-ldconfig -v 
-</code> 
-  * -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, /lib64, /usr/lib) 
- 
-====== Override Search Order ====== 
- 
-To get a path specified in front of another, define the environmental variable "LD_LIBRARY_PATH" in a configuration file (per user or system wide). 
- 
-\\ 
-Example: Ensure that /usr/lib64 is ahead of /usr/local/lib for user "robert" 
-<code bash> 
-vim /home/robert/.bashrc 
- 
-LD_LIBRARY_PATH=/usr/lib64:${LD_LIBRARY_PATH} 
-</code> 
-  * Including the "${LD_LIBRARY_PATH}" as a second entry ensures that nothing is completely over written if the variable has been set elsewhere 
- 
----- 
  
  • linux_wiki/library_paths.txt
  • Last modified: 2019/05/25 23:50
  • (external edit)