Article Title: dynamic link library management command Ldconfig instructions for use. Linux is a technology channel of the IT lab in China. Including desktop applications, Linux system management, kernel research, embedded systems, open-source, and other basic classification Linux systems. In order to share dynamic link libraries with the system, you also need to run the management command-ldconfig.
1. the ldconfig command is mainly used in the default search directory (/lib and/usr/lib) and dynamic library configuration file/etc/ld. so. find the shared dynamic link library under the directory listed in conf (format as described earlier, lib *. so *) to create a dynamic loader (ld. so) the required connection and cache file. The default cache file is/etc/ld. so. cache. This file stores the list of Dynamic Linked Library names sorted.
2. ldconfig is usually run when the system starts. When you install a new dynamic link library, you need to manually run this command.
3. Use the ldconfig command line as follows:
ldconfig [-v|--verbose] [-n] [-N] [-X] [-f CONF] [-C CACHE] [-r ROOT] [-l][-p|--print-cache] [-c FORMAT] [--format=FORMAT] [-V] [-?|--help|--usage] path... |
4. The options available for ldconfig are described as follows:
(1)-v or -- verbose: When this option is used, ldconfig displays the directory being scanned, The searched dynamic link library, and the name of the connection it created.
(2)-n: When this option is used, ldconfig only scans the directory specified by the command line and does not scan the default directory (/lib,/usr/lib ), nor scan the configuration file/etc/ld. so. conf.
(3)-N: This option indicates that ldconfig does not recreate the cache file (/etc/ld. so. cache ). If the-X option is not used, ldconfig updates the file connection as usual.
(4)-X: This option indicates that ldconfig does not update the file connection. If the-N option is not used, the cached file is updated normally.
(5)-f CONF: This option specifies that the configuration file of the dynamic link library is CONF, and the default value is/etc/ld. so. conf.
(6)-c cache: This option specifies that the generated CACHE file is CACHE. The default value is/etc/ld. so. cache. This file stores the list of dynamically linked libraries that can be shared in the sorted order.
(7)-r ROOT: This option changes the ROOT directory of the application to ROOT (implemented by calling the chroot function ). When this option is selected, the system default configuration file/etc/ld. so. conf, which corresponds to ROOT/etc/ld. so. conf. for example, when-r/usr/zzz is used, open the configuration file/etc/ld. so. in conf,/usr/zzz/etc/ld is actually enabled. so. conf file. This option can greatly increase the flexibility of dynamic link library management.
(8)-l: Generally, ldconfig automatically establishes a connection to the dynamic link library when searching for a dynamic link library. When this option is selected, the expert mode is enabled and the connection needs to be set manually. This option is not required for general users.
(9)-p or -- print-cache: This option indicates that ldconfig prints the names of all the shared libraries saved in the current cache file.
(10)-c FORMAT or -- format = FORMAT: This option is used to specify the FORMAT used by the cache file. There are three types: old (old format), new (new FORMAT) and compat (compatible format, which is the default format ).
(11)-V: This option prints the version information of ldconfig and then exits.
(12 )-? Or -- help or -- usage: the three options share the same role, so that ldconfig prints the help information and then exits.