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