{
    "mode": "man",
    "parameter": "ldconfig",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/ldconfig/8/json",
    "generated": "2026-06-02T23:33:17Z",
    "synopsis": "/sbin/ldconfig [-nNvXV] [-f conf] [-C cache] [-r root] directory...\n/sbin/ldconfig -l [-v] library...",
    "sections": {
        "NAME": {
            "content": "ldconfig - configure dynamic linker run-time bindings\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "/sbin/ldconfig [-nNvXV] [-f conf] [-C cache] [-r root] directory...\n/sbin/ldconfig -l [-v] library...",
            "subsections": [
                {
                    "name": "/sbin/ldconfig -p",
                    "content": ""
                }
            ]
        },
        "DESCRIPTION": {
            "content": "ldconfig  creates  the necessary links and cache to the most recent shared libraries found in\nthe directories specified on the command line,  in  the  file  /etc/ld.so.conf,  and  in  the\ntrusted directories, /lib and /usr/lib (on some 64-bit architectures such as x86-64, /lib and\n/usr/lib are the trusted directories for 32-bit libraries, while /lib64  and  /usr/lib64  are\nused for 64-bit libraries).\n\nThe  cache  is used by the run-time linker, ld.so or ld-linux.so.  ldconfig checks the header\nand filenames of the libraries it encounters when  determining  which  versions  should  have\ntheir links updated.\n\nldconfig  will attempt to deduce the type of ELF libraries (i.e., libc5 or libc6/glibc) based\non what C libraries, if any, the library was linked against.\n\nSome existing libraries do not contain enough information to allow  the  deduction  of  their\ntype.   Therefore,  the  /etc/ld.so.conf  file format allows the specification of an expected\ntype.  This is used only for those ELF libraries which we can not work out.   The  format  is\n\"dirname=TYPE\",  where  TYPE  can  be libc4, libc5, or libc6.  (This syntax also works on the\ncommand line.)  Spaces are not allowed.  Also see the -p option.  ldconfig should normally be\nrun  by  the  superuser as it may require write permission on some root owned directories and\nfiles.\n\nNote that ldconfig will only look at files that are named lib*.so* (for  regular  shared  ob‐\njects)  or ld-*.so* (for the dynamic loader itself).  Other files will be ignored.  Also, ld‐‐\nconfig expects a certain pattern to how the symlinks are set up, like this example, where the\nmiddle file (libfoo.so.1 here) is the SONAME for the library:\n\nlibfoo.so -> libfoo.so.1 -> libfoo.so.1.12\n\nFailure to follow this pattern may result in compatibility issues after an upgrade.\n",
            "subsections": []
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-c --format=",
                    "content": "(Since glibc 2.2) Cache format to use: old, new, or compat.  Since glibc 2.32, the de‐\nfault is new.  Before that, it was compat.\n",
                    "flag": "-c"
                },
                {
                    "name": "-C",
                    "content": "Use cache instead of /etc/ld.so.cache.\n",
                    "flag": "-C"
                },
                {
                    "name": "-f",
                    "content": "Use conf instead of /etc/ld.so.conf.\n",
                    "flag": "-f"
                },
                {
                    "name": "-i --ignore-aux-cache",
                    "content": "(Since glibc 2.7) Ignore auxiliary cache file.\n",
                    "flag": "-i",
                    "long": "--ignore-aux-cache"
                },
                {
                    "name": "-l",
                    "content": "by experts only.\n",
                    "flag": "-l"
                },
                {
                    "name": "-n",
                    "content": "directories, nor those specified in /etc/ld.so.conf.  Implies -N.\n",
                    "flag": "-n"
                },
                {
                    "name": "-N -X",
                    "content": "",
                    "flag": "-X"
                },
                {
                    "name": "-p --print-cache",
                    "content": "Print the lists of directories and candidate libraries stored in the current cache.\n",
                    "flag": "-p",
                    "long": "--print-cache"
                },
                {
                    "name": "-r",
                    "content": "Change to and use root as the root directory.\n",
                    "flag": "-r"
                },
                {
                    "name": "-v --verbose",
                    "content": "Verbose mode.  Print current version number, the name  of  each  directory  as  it  is\nscanned, and any links that are created.  Overrides quiet mode.\n",
                    "flag": "-v",
                    "long": "--verbose"
                },
                {
                    "name": "-V --version",
                    "content": "Print program version.\n",
                    "flag": "-V",
                    "long": "--version"
                },
                {
                    "name": "-X -N",
                    "content": "",
                    "flag": "-N"
                }
            ]
        },
        "FILES": {
            "content": "/lib/ld.so\nRun-time linker/loader.\n/etc/ld.so.conf\nFile containing a list of directories, one per line, in which to search for libraries.\n/etc/ld.so.cache\nFile  containing  an  ordered  list of libraries found in the directories specified in\n/etc/ld.so.conf, as well as those found in the trusted directories.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "ldd(1), ld.so(8)\n",
            "subsections": []
        },
        "COLOPHON": {
            "content": "This page is part of release 5.10 of the Linux  man-pages  project.   A  description  of  the\nproject,  information about reporting bugs, and the latest version of this page, can be found\nat https://www.kernel.org/doc/man-pages/.\n\n\n\nGNU                                          2020-06-09                                  LDCONFIG(8)",
            "subsections": []
        }
    },
    "summary": "ldconfig - configure dynamic linker run-time bindings",
    "flags": [
        {
            "flag": "-c",
            "long": null,
            "arg": null,
            "description": "(Since glibc 2.2) Cache format to use: old, new, or compat. Since glibc 2.32, the de‐ fault is new. Before that, it was compat."
        },
        {
            "flag": "-C",
            "long": null,
            "arg": null,
            "description": "Use cache instead of /etc/ld.so.cache."
        },
        {
            "flag": "-f",
            "long": null,
            "arg": null,
            "description": "Use conf instead of /etc/ld.so.conf."
        },
        {
            "flag": "-i",
            "long": "--ignore-aux-cache",
            "arg": null,
            "description": "(Since glibc 2.7) Ignore auxiliary cache file."
        },
        {
            "flag": "-l",
            "long": null,
            "arg": null,
            "description": "by experts only."
        },
        {
            "flag": "-n",
            "long": null,
            "arg": null,
            "description": "directories, nor those specified in /etc/ld.so.conf. Implies -N."
        },
        {
            "flag": "-X",
            "long": null,
            "arg": null,
            "description": ""
        },
        {
            "flag": "-p",
            "long": "--print-cache",
            "arg": null,
            "description": "Print the lists of directories and candidate libraries stored in the current cache."
        },
        {
            "flag": "-r",
            "long": null,
            "arg": null,
            "description": "Change to and use root as the root directory."
        },
        {
            "flag": "-v",
            "long": "--verbose",
            "arg": null,
            "description": "Verbose mode. Print current version number, the name of each directory as it is scanned, and any links that are created. Overrides quiet mode."
        },
        {
            "flag": "-V",
            "long": "--version",
            "arg": null,
            "description": "Print program version."
        },
        {
            "flag": "-N",
            "long": null,
            "arg": null,
            "description": ""
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "ldd",
            "section": "1",
            "url": "https://www.chedong.com/phpMan.php/man/ldd/1/json"
        },
        {
            "name": "ld.so",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/ld.so/8/json"
        }
    ],
    "tldr": {
        "source": "official",
        "description": "Configure symlinks and cache for shared library dependencies.",
        "examples": [
            {
                "description": "Update symlinks and rebuild the cache (usually run when a new library is installed)",
                "command": "sudo ldconfig"
            },
            {
                "description": "Update the symlinks for a given directory",
                "command": "sudo ldconfig -n {{path/to/directory}}"
            },
            {
                "description": "Print the libraries in the cache and check whether a given library is present",
                "command": "ldconfig {{-p|--print-cache}} | grep {{library_name}}"
            }
        ]
    }
}