aboutsummaryrefslogtreecommitdiffstats
path: root/man8/ldconfig.8
blob: 852b5d5ca98f4fe72ccd1b8197bc9011d3ddd19d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
.\" Copyright 1999 SuSE GmbH Nuernberg, Germany
.\" Author: Thorsten Kukuk <kukuk@suse.de>
.\"
.\" %%%LICENSE_START(GPLv2+_SW_3_PARA)
.\" This program is free software; you can redistribute it and/or
.\" modify it under the terms of the GNU General Public License as
.\" published by the Free Software Foundation; either version 2 of the
.\" License, or (at your option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
.\" General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public
.\" License along with this manual; if not, see
.\" <http://www.gnu.org/licenses/>.
.\" %%%LICENSE_END
.\"
.\" Modified, 6 May 2002, Michael Kerrisk, <mtk.manpages@gmail.com>
.\"   Change listed order of /usr/lib and /lib
.TH LDCONFIG 8 2020-06-09 "GNU" "Linux Programmer's Manual"
.SH NAME
ldconfig \- configure dynamic linker run-time bindings
.SH SYNOPSIS
.BR /sbin/ldconfig " [" \-nNvXV "] [" \-f " \fIconf\fP] [" \-C " \fIcache\fP] [" \-r " \fIroot\fP]"
.IR directory \...
.PD 0
.PP
.PD
.B /sbin/ldconfig
.B \-l
.RB [ \-v ]
.IR library \...
.PD 0
.PP
.PD
.B /sbin/ldconfig
.B \-p
.SH DESCRIPTION
.B ldconfig
creates the necessary links and cache to the most recent shared
libraries found in the directories specified on the command line,
in the file
.IR /etc/ld.so.conf ,
and in the trusted directories,
.I /lib
and
.IR /usr/lib
(on some 64-bit architectures such as x86-64,
.I /lib
and
.IR /usr/lib
are the trusted directories for 32-bit libraries, while
.I /lib64
and
.IR /usr/lib64
are used for 64-bit libraries).
.PP
The cache is used by the run-time linker,
.I ld.so
or
.IR ld-linux.so .
.B ldconfig
checks the header and filenames of the libraries it encounters when
determining which versions should have their links updated.
.PP
.B ldconfig
will attempt to deduce the type of ELF libraries (i.e., libc5 or libc6/glibc)
based on what C libraries, if any, the library was linked against.
.\" The following sentence looks suspect
.\" (perhaps historical cruft) -- MTK, Jul 2005
.\" Therefore, when making dynamic libraries,
.\" it is wise to explicitly link against libc (use \-lc).
.PP
Some existing libraries do not contain enough information
to allow the deduction of their type.
Therefore, the
.I /etc/ld.so.conf
file format allows the specification of an expected type.
This is used
.I only
for those ELF libraries which we can not work out.
The format
is "dirname=TYPE", where TYPE can be libc4, libc5, or libc6.
(This syntax also works on the command line.)
Spaces are
.I not
allowed.
Also see the
.B \-p
option.
.B ldconfig
should normally be run by the superuser as it may require write
permission on some root owned directories and files.
.PP
Note that
.B ldconfig
will only look at files that are named
.I lib*.so*
(for regular shared objects) or
.I ld-*.so*
(for the dynamic loader itself).
Other files will be ignored.
Also,
.B ldconfig
expects a certain pattern to how the symlinks are set up, like this
example, where the middle file
.RB ( libfoo.so.1
here) is the SONAME for the library:
.PP
.in +4n
.EX
libfoo.so \-> libfoo.so.1 \-> libfoo.so.1.12
.EE
.in
.PP
Failure to follow this pattern may result in compatibility issues
after an upgrade.
.SH OPTIONS
.TP
.BR \-c " \fIfmt\fP, " \-\-format=\fIfmt\fP
(Since glibc 2.2)
Cache format to use:
.IR old ,
.IR new ,
or
.IR compat .
Since glibc 2.32, the default is
.IR new .
.\" commit cad64f778aced84efdaa04ae64f8737b86f063ab
Before that, it was
.IR compat .
.TP
.BI "\-C " cache
Use
.I cache
instead of
.IR /etc/ld.so.cache .
.TP
.BI "\-f " conf
Use
.I conf
instead of
.IR /etc/ld.so.conf .
.\" FIXME glibc 2.7 added -i
.TP
.BR \-i ", " \-\-ignore\-aux\-cache
(Since glibc 2.7)
.\"             commit 27d9ffda17df4d2388687afd12897774fde39bcc
Ignore auxiliary cache file.
.TP
.B \-l
(Since glibc 2.2)
Library mode.
Manually link individual libraries.
Intended for use by experts only.
.TP
.B \-n
Process only the directories specified on the command line.
Don't process the trusted directories,
nor those specified in
.IR /etc/ld.so.conf .
Implies
.BR \-N .
.TP
.B \-N
Don't rebuild the cache.
Unless
.B \-X
is also specified, links are still updated.
.TP
.BR \-p ", " \-\-print\-cache
Print the lists of directories and candidate libraries stored in
the current cache.
.TP
.BI "\-r " root
Change to and use
.I root
as the root directory.
.TP
.BR \-v ", " \-\-verbose
Verbose mode.
Print current version number, the name of each directory as it
is scanned, and any links that are created.
Overrides quiet mode.
.TP
.BR \-V ", " \-\-version
Print program version.
.TP
.B \-X
Don't update links.
Unless
.B \-N
is also specified, the cache is still rebuilt.
.SH FILES
.\" FIXME Since glibc-2.3.4, "include" directives are supported in ld.so.conf
.\"
.\" FIXME Since glibc-2.4, "hwcap" directives are supported in ld.so.conf
.PD 0
.TP
.I /lib/ld.so
Run-time linker/loader.
.TP
.I /etc/ld.so.conf
File containing a list of directories, one per line,
in which to search for libraries.
.TP
.I /etc/ld.so.cache
File containing an ordered list of libraries found in the directories
specified in
.IR /etc/ld.so.conf ,
as well as those found in the trusted directories.
.PD
.SH SEE ALSO
.BR ldd (1),
.BR ld.so (8)