Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the use of the dynamic link library management command Ldconfig in Linux system

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the Linux system dynamic link library management command Ldconfig what is useful, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian with you to understand.

Linux system dynamic link library management command Ldconfig how to use

1. The purpose of the ldconfig command is to search for shareable dynamic link libraries (format as described above, lib*.so*) under the default search directory (/ lib and / usr/lib) and the directory listed in the dynamic library configuration file / etc/ld.so.conf, and then create the connection and cache files required by the dynamic loader (ld.so). The cache file defaults to / etc/ld.so.cache, which holds a sorted list of dynamic-link library names.

2. Ldconfig usually runs at system startup, and when the user installs a new dynamic link library, you need to run this command manually.

3. The command line usage of ldconfig is 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 as follows:

(1)-v or-- verbose: when using this option, ldconfig will display the directory being scanned and the dynamic link library searched, as well as the name of the connection it created.

(2)-n: with this option, ldconfig scans only the directories specified on the command line, not the default directory (/ lib,/usr/lib), nor the directories listed in the configuration file / etc/ld.so.conf.

(3)-N: this option instructs ldconfig not to rebuild the cache file (/ etc/ld.so.cache). If the-X option is not used, ldconfig updates the connection to the file as usual

(4)-X: this option instructs ldconfig not to update the connection to the file. If the-N option is not used, the cache file is updated normally.

(5)-f CONF: this option specifies that the configuration file of the dynamic link library is CONF, and the system defaults to / etc/ld.so.conf.

(6)-C CACHE: this option specifies that the generated cache file is CACHE, and the default is / etc/ld.so.cache, which holds a sorted list of shareable dynamic link libraries.

Linux system dynamic link library management command Ldconfig how to use

(7)-r ROOT: this option changes the root directory of the application to ROOT (implemented by calling the chroot function). When you select this option, the system default configuration file / etc/ld.so.conf, the actual corresponding is ROOT/etc/ld.so.conf. If you use-r / usr/zzz, when you open the configuration file / etc/ld.so.conf, you actually open the / usr/zzz/etc/ld.so.conf file. With this option, you can greatly increase the flexibility of dynamic link library management.

(8)-l: normally, ldconfig will automatically establish a connection to a dynamic link library when it searches for it. When you select this option, you will enter expert mode and need to set up the connection manually. General users do not need this item.

(9)-p or-- print-cache: this option instructs ldconfig to print out the names of all shared libraries saved by the current cache file.

(10)-c FORMAT or-- format=FORMAT: this option specifies the format used by the cache file. There are three formats: old (old format), new (new format), and compat (compatible format, which is the default format).

(11)-V: this option prints out the version information of ldconfig and then exits.

(12)? Or-- help or-- usage: all three options have the same effect, asking ldconfig to print out its help information and then exit.

Thank you for reading this article carefully. I hope the article "what is the use of Ldconfig in Linux system dynamic link library management command" shared by the editor will be helpful to you. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report