• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

ldconfig Command Examples in Linux

by Deepika

ldconfig is a command-line tool that is used to configure the dynamic linker run-time bindings, by creating, updating, and removing symbolic links and cache files for shared libraries on a Linux system. It is typically run as a system administrator task, typically at boot time and after installing new shared libraries.

The ldconfig command reads the file /etc/ld.so.conf and the directories specified in that file, and creates a cache file that is used by the dynamic linker, ld.so, to resolve shared library dependencies at runtime. The cache file is typically located at /etc/ld.so.cache.

When ldconfig is run, it scans the specified directories and creates symbolic links in the standard library directories, such as /usr/lib, /lib, and /usr/local/lib, that point to the shared libraries found in the scanned directories. It also creates the cache file that is used by the dynamic linker to resolve shared library dependencies at runtime. By default, ldconfig will scan the directories specified in /etc/ld.so.conf, but you can also specify additional directories to scan on the command line. You can use the -p option to display the current contents of the cache file and -v option to see which libraries are being processed.

ldconfig Command Examples

1. Update symlinks and rebuild the cache (usually run when a new library is installed):

# sudo ldconfig

2. Update the symlinks for a given directory:

# sudo ldconfig -n path/to/directory

3. Print the libraries in the cache and check whether a given library is present:

# ldconfig -p | grep library_name

Summary

In summary, ldconfig is a command-line tool that configures the dynamic linker run-time bindings, by creating, updating, and removing symbolic links and cache files for shared libraries on a Linux system. It is typically run as a system administrator task, typically at boot time and after installing new shared libraries. It helps ensure that the system can find and use all of the necessary shared libraries for the programs that are installed on the system.

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to make a LED flash with the Raspberry Pi
  2. Understanding dm-Multipath Identifiers in Linux
  3. Understanding the Network interface configuration file /etc/sysconfig/network-scripts/ifcfg-eth#
  4. chfn Command Examples in Linux
  5. gzip: command not found
  6. How to create snapshot of LVM thin volumes using snapper command
  7. Volume “test_vg/lvol0” is not active locally – Error while running lvcreate
  8. aws backup: Unified backup service designed to protect Amazon Web Services services and their associated data
  9. namcap: command not found
  10. apt-cache Command Examples

You May Also Like

Primary Sidebar

Recent Posts

  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples
  • “glab mr” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright