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