In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article will explain in detail how to use the ldconfig command about linux. The editor thinks it is very practical, so I share it for you as a reference. I hope you can get something after reading this article.
Ldconfig is a dynamic link library management command, its purpose is to make the dynamic link library shared by the system.
Ldconfig usually runs at system startup, and when the user installs a new dynamic link library, you need to run this command manually.
Grammar
Ldconfig [- v |-- verbose] [- n] [- N] [- X] [- f CONF] [- C CACHE] [- r ROOT] [- l] [- p |-- print-cache] [- c FORMAT] [--format=FORMAT] [- V] [--help |-- usage] path...
Option
-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. -n: with this option, ldconfig scans only the directories specified on the command line, not the default directories (/ lib, / usr/lib), nor the directories listed in the configuration file / etc/ld.so.conf. -N: this option instructs ldconfig not to rebuild the cache file (/ etc/ld.so.cache), and if the-X option is not used, ldconfig updates the connection to the file as usual. -X: this option instructs ldconfig not to update the connection to the file. If the-N option is not used, the cache file updates normally. -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. -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. -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. -l: normally, ldconfig will automatically establish a connection to a dynamic link library when searching for a dynamic link library. When you select this option, you will enter expert mode and need to set the connection manually. General users do not need this item. -p or-- print-cache: this option instructs ldconfig to print out the names of all shared libraries saved by the current cache file. -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). -V: this option prints out the version information of ldconfig and then exits. -? Or-- help or-- usage: all three options have the same effect, asking ldconfig to print out its help information and then exit.
There are several things to pay attention to in ldconfig:
You don't need to modify / etc/ld.so.conf to add something to / lib and / usr/lib, but adjust the ldconfig after you finish, otherwise the library will not be found. When you want to add something to the above two directories, be sure to modify / etc/ld.so.conf, and then call ldconfig, or you won't be able to find it. For example, if you install a mysql to / usr/local/mysql,mysql and have a lot of library under / usr/local/mysql/lib, you need to add a line / usr/local/mysql/lib under / etc/ld.so.conf, save it and ldconfig it before the new library can be found when the program is running. If you want to put lib outside these two directories, but you don't want to add something to / etc/ld.so.conf (or you don't have permission to add something). That's OK, that's export, a global variable LD_LIBRARY_PATH, and then when you run the program, you will go to this directory to find library. Generally speaking, this is only a temporary solution, used when there is no permission or temporary need. What ldconfig does is related to running the program and has nothing to do with compile time. When compiling, you still have to add-L, so don't get confused. In short, no matter what changes have been made to library, it's best to ldconfig them, or there will be some unexpected results. It won't take much time, but it will save a lot of trouble. In addition, the header of a file such as libdb-4.3.so contains information related to the library name (that is, it contains "libdb-4.3.so", which can be viewed with the strings command), so it is not possible to change the file name to pretend to be a recognized library (such as libdb-4.8.so). To do this, you can directly modify the configuration information in the Makefile of the compiled library to specify a special library name. This is the end of the article on "how to use the ldconfig command of linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.