ldconfig command is used to tell the system about new locations of shared libraries, the ldconfig command uses information provided by the /etc/ld.so.conf file.
The ldconfig command creates a cache database of all libraries based on the configura- tion file. This cache is normally stored in the /etc/ld.so.cache file. Here is the syntax of the ldconfig command:
# ldconfig [option]
Example:
$ ldconfig -p | head 945 libs found in cache '/etc/ld.so.cache' p11-kit-trust.so (libc6,x86-64) => /lib64/p11-kit-trust.so libzapojit-0.0.so.0 (libc6,x86-64) => /lib64/libzapojit-0.0.so.0 libz.so.1 (libc6,x86-64) => /lib64/libz.so.1 libyelp.so.0 (libc6,x86-64) => /lib64/libyelp.so.0 libyaml-0.so.2 (libc6,x86-64) => /lib64/libyaml-0.so.2 libyajl.so.2 (libc6,x86-64) => /lib64/libyajl.so.2 libxtables.so.10 (libc6,x86-64) => /lib64/libxtables.so.10 libxslt.so.1 (libc6,x86-64) => /lib64/libxslt.so.1 libxshmfence.so.1 (libc6,x86-64) => /lib64/libxshmfence.so.1
ldconfig Command Options
Option | Description |
---|---|
-c fmt, –format=fmt | Cache format to use: old, new, or compat. |
-C cache | Use cache instead of /etc/ld.so.cache. |
-f conf | Use conf instead of /etc/ld.so.conf. |
-i, –ignore-aux-cache | Ignore auxiliary cache file. |
-l | Library mode. Manually link individual libraries. Intended for use by experts only. |
-n | Process only the directories specified on the command line. Don’t process the trusted directories, nor those specified in /etc/ld.so.conf. Implies -N. |
-N | Don’t rebuild the cache. Unless -X is also specified, links are still updated. |
-p, –print-cache | Print the lists of directories and candidate libraries stored in the current cache. |
-r root | Change to and use root as the root directory. |
-v, –verbose | Verbose mode. Print current version number, the name of each directory as it is scanned, and any links that are created. Overrides quiet mode. |
-V, –version | Print program version. |
-X | Don’t update links. Unless -N is also specified, the cache is still rebuilt. |