| 1 |
.\" Copyright 1999, SuSE GmbH |
| 2 |
.\" Copyright, the authors of the Linux man-pages project |
| 3 |
.\" |
| 4 |
.\" SPDX-License-Identifier: GPL-2.0-or-later |
| 5 |
.\" |
| 6 |
.TH ldconfig 8 2026-02-08 "Linux man-pages 6.18" |
| 7 |
.SH NAME |
| 8 |
ldconfig \- configure dynamic linker run-time bindings |
| 9 |
.SH SYNOPSIS |
| 10 |
.SY /sbin/ldconfig |
| 11 |
.\" TODO?: -c, --format, -i, --ignore-aux-cache, --print-cache, |
| 12 |
.\" --verbose, -V, --version, -?, --help, --usage |
| 13 |
.RB [ \-nNvVX ] |
| 14 |
.RB [ \-C\~\c |
| 15 |
.IR cache ] |
| 16 |
.RB [ \-f\~\c |
| 17 |
.IR conf ] |
| 18 |
.RB [ \-r\~\c |
| 19 |
.IR root ] |
| 20 |
.IR directory \~.\|.\|. |
| 21 |
.YS |
| 22 |
.SY /sbin/ldconfig |
| 23 |
.B \-l |
| 24 |
.RB [ \-v ] |
| 25 |
.IR library \~.\|.\|. |
| 26 |
.YS |
| 27 |
.SY /sbin/ldconfig |
| 28 |
.B \-p |
| 29 |
.YS |
| 30 |
.SH DESCRIPTION |
| 31 |
.B \%ldconfig |
| 32 |
creates the necessary links and cache to the most recent shared |
| 33 |
libraries found in the directories specified on the command line, |
| 34 |
in the file |
| 35 |
.IR /etc/ld.so.conf , |
| 36 |
and in the trusted directories, |
| 37 |
.I /lib |
| 38 |
and |
| 39 |
.IR /usr/lib . |
| 40 |
On some 64-bit architectures such as x86-64, |
| 41 |
.I /lib |
| 42 |
and |
| 43 |
.I /usr/lib |
| 44 |
are the trusted directories for 32-bit libraries, |
| 45 |
while |
| 46 |
.I /lib64 |
| 47 |
and |
| 48 |
.I /usr/lib64 |
| 49 |
are used for 64-bit libraries. |
| 50 |
.P |
| 51 |
The cache is used by the run-time linker, |
| 52 |
.I ld.so |
| 53 |
or |
| 54 |
.IR ld\-linux.so . |
| 55 |
.B \%ldconfig |
| 56 |
checks the header and filenames of the libraries it encounters when |
| 57 |
determining which versions should have their links updated. |
| 58 |
.\" Support for libc4 and libc5 dropped in |
| 59 |
.\" 8ee878592c4a642937152c8308b8faef86bcfc40 (2022-07-14) as "obsolete |
| 60 |
.\" for over twenty years". |
| 61 |
.B \%ldconfig |
| 62 |
should normally be run by the superuser as it may require write |
| 63 |
permission on some root owned directories and files. |
| 64 |
.P |
| 65 |
.B \%ldconfig |
| 66 |
will look only at files that are named |
| 67 |
.I lib*.so* |
| 68 |
(for regular shared objects) or |
| 69 |
.I ld\-*.so* |
| 70 |
(for the dynamic loader itself). |
| 71 |
Other files will be ignored. |
| 72 |
Also, |
| 73 |
.B \%ldconfig |
| 74 |
expects a certain pattern to how the symbolic links are set up, |
| 75 |
like this example, |
| 76 |
where the middle file |
| 77 |
.RB ( libfoo.so.1 |
| 78 |
here) is the SONAME for the library: |
| 79 |
.P |
| 80 |
.in +4n |
| 81 |
.EX |
| 82 |
libfoo.so \-> libfoo.so.1 \-> libfoo.so.1.12 |
| 83 |
.EE |
| 84 |
.in |
| 85 |
.P |
| 86 |
Failure to follow this pattern may result in compatibility issues |
| 87 |
after an upgrade. |
| 88 |
.SH OPTIONS |
| 89 |
.TP |
| 90 |
.BI \-\-format= fmt |
| 91 |
.TQ |
| 92 |
.BI \-c\~ fmt |
| 93 |
(Since glibc 2.2) |
| 94 |
.\" commit 45eca4d141c047950db48c69c8941163d0a61fcd |
| 95 |
Use cache format |
| 96 |
.IR fmt , |
| 97 |
which is one of |
| 98 |
.BR old , |
| 99 |
.BR new , |
| 100 |
or |
| 101 |
.BR \%compat . |
| 102 |
Since glibc 2.32, |
| 103 |
the default is |
| 104 |
.BR new . |
| 105 |
.\" commit cad64f778aced84efdaa04ae64f8737b86f063ab |
| 106 |
Before that, |
| 107 |
it was |
| 108 |
.BR \%compat . |
| 109 |
.TP |
| 110 |
.BI \-C\~ cache |
| 111 |
Use |
| 112 |
.I cache |
| 113 |
instead of |
| 114 |
.IR /etc/ld.so.cache . |
| 115 |
.TP |
| 116 |
.BI \-f\~ conf |
| 117 |
Use |
| 118 |
.I conf |
| 119 |
instead of |
| 120 |
.IR /etc/ld.so.conf . |
| 121 |
.TP |
| 122 |
.B \-\-ignore\-aux\-cache |
| 123 |
.TQ |
| 124 |
.B \-i |
| 125 |
(Since glibc 2.7) |
| 126 |
.\" commit 27d9ffda17df4d2388687afd12897774fde39bcc |
| 127 |
Ignore auxiliary cache file. |
| 128 |
.TP |
| 129 |
.B \-l |
| 130 |
(Since glibc 2.2) |
| 131 |
Interpret each operand as a library name and configure its links. |
| 132 |
Intended for use only by experts. |
| 133 |
.TP |
| 134 |
.B \-n |
| 135 |
Process only the directories specified on the command line; |
| 136 |
don't process the trusted directories, |
| 137 |
nor those specified in |
| 138 |
.IR /etc/ld.so.conf . |
| 139 |
Implies |
| 140 |
.BR \-N . |
| 141 |
.TP |
| 142 |
.B \-N |
| 143 |
Don't rebuild the cache. |
| 144 |
Unless |
| 145 |
.B \-X |
| 146 |
is also specified, |
| 147 |
links are still updated. |
| 148 |
.TP |
| 149 |
.B \-\-print\-cache |
| 150 |
.TQ |
| 151 |
.B \-p |
| 152 |
Print the lists of directories and candidate libraries stored in |
| 153 |
the current cache. |
| 154 |
.TP |
| 155 |
.BI \-r\~ root |
| 156 |
Change to and use |
| 157 |
.I root |
| 158 |
as the root directory. |
| 159 |
.TP |
| 160 |
.B \-\-verbose |
| 161 |
.TQ |
| 162 |
.B \-v |
| 163 |
Verbose mode. |
| 164 |
Print current version number, |
| 165 |
the name of each directory as it is scanned, |
| 166 |
and any links that are created. |
| 167 |
Overrides quiet mode. |
| 168 |
.TP |
| 169 |
.B \-\-version |
| 170 |
.TQ |
| 171 |
.B \-V |
| 172 |
Print program version. |
| 173 |
.TP |
| 174 |
.B \-X |
| 175 |
Don't update links. |
| 176 |
Unless |
| 177 |
.B \-N |
| 178 |
is also specified, |
| 179 |
the cache is still rebuilt. |
| 180 |
.SH FILES |
| 181 |
.\" FIXME Since glibc-2.3.4, "include" directives are supported in ld.so.conf |
| 182 |
.\" |
| 183 |
.\" FIXME Since glibc-2.4, "hwcap" directives are supported in ld.so.conf |
| 184 |
.PD 0 |
| 185 |
.TP |
| 186 |
.I /lib/ld.so |
| 187 |
is the run-time linker/loader. |
| 188 |
.TP |
| 189 |
.I /etc/ld.so.conf |
| 190 |
contains a list of directories, |
| 191 |
one per line, |
| 192 |
in which to search for libraries. |
| 193 |
.TP |
| 194 |
.I /etc/ld.so.cache |
| 195 |
contains an ordered list of libraries found in the directories |
| 196 |
specified in |
| 197 |
.IR /etc/ld.so.conf , |
| 198 |
as well as those found in the trusted directories. |
| 199 |
.PD |
| 200 |
.SH SEE ALSO |
| 201 |
.BR ldd (1), |
| 202 |
.BR ld.so (8) |