man-pages/man8/ldconfig.8.html
2021-03-31 01:06:50 +01:00

316 lines
5.6 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of LDCONFIG</TITLE>
</HEAD><BODY>
<H1>LDCONFIG</H1>
Section: Linux Programmer's Manual (8)<BR>Updated: 2020-02-09<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
ldconfig - configure dynamic linker run-time bindings
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<B>/sbin/ldconfig</B> [<B>-nNvXV</B>] [<B>-f</B> <I>conf</I>] [<B>-C</B> <I>cache</I>] [<B>-r</B> <I>root</I>]
<I>directory</I>...
<P>
<B>/sbin/ldconfig</B>
<B>-l</B>
[<B>-v</B>]
<I>library</I>...
<P>
<B>/sbin/ldconfig</B>
<B>-p</B>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
<B>ldconfig</B>
creates the necessary links and cache to the most recent shared
libraries found in the directories specified on the command line,
in the file
<I>/etc/ld.so.conf</I>,
and in the trusted directories,
<I>/lib</I>
and
<I>/usr/lib</I>
(on some 64-bit architectures such as x86-64,
<I>/lib</I>
and
<I>/usr/lib</I>
are the trusted directories for 32-bit libraries, while
<I>/lib64</I>
and
<I>/usr/lib64</I>
are used for 64-bit libraries).
<P>
The cache is used by the run-time linker,
<I>ld.so</I>
or
<I>ld-linux.so</I>.
<B>ldconfig</B>
checks the header and filenames of the libraries it encounters when
determining which versions should have their links updated.
<P>
<B>ldconfig</B>
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.
<P>
Some existing libraries do not contain enough information
to allow the deduction of their type.
Therefore, the
<I>/etc/ld.so.conf</I>
file format allows the specification of an expected type.
This is used
<I>only</I>
for those ELF libraries which we can not work out.
The format
is &quot;dirname=TYPE&quot;, where TYPE can be libc4, libc5, or libc6.
(This syntax also works on the command line.)
Spaces are
<I>not</I>
allowed.
Also see the
<B>-p</B>
option.
<B>ldconfig</B>
should normally be run by the superuser as it may require write
permission on some root owned directories and files.
<P>
Note that
<B>ldconfig</B>
will only look at files that are named
<I>lib*.so*</I>
(for regular shared objects) or
<I>ld-*.so*</I>
(for the dynamic loader itself).
Other files will be ignored.
Also,
<B>ldconfig</B>
expects a certain pattern to how the symlinks are set up, like this
example, where the middle file
(<B>libfoo.so.1</B>
here) is the SONAME for the library:
<P>
libfoo.so -&gt; libfoo.so.1 -&gt; libfoo.so.1.12
<P>
Failure to follow this pattern may result in compatibility issues
after an upgrade.
<A NAME="lbAE">&nbsp;</A>
<H2>OPTIONS</H2>
<DL COMPACT>
<DT id="1"><B>-c</B> <I>fmt</I>, <B>--format=</B><I>fmt</I>
<DD>
(Since glibc 2.2)
Cache format to use:
<I>old</I>,
<I>new</I>,
or
<I>compat</I>
(default).
<DT id="2"><B>-C </B><I>cache</I>
<DD>
Use
<I>cache</I>
instead of
<I>/etc/ld.so.cache</I>.
<DT id="3"><B>-f </B><I>conf</I>
<DD>
Use
<I>conf</I>
instead of
<I>/etc/ld.so.conf</I>.
<DT id="4"><B>-i</B>, <B>--ignore-aux-cache</B>
<DD>
(Since glibc 2.7)
Ignore auxiliary cache file.
<DT id="5"><B>-l</B>
<DD>
(Since glibc 2.2)
Library mode.
Manually link individual libraries.
Intended for use by experts only.
<DT id="6"><B>-n</B>
<DD>
Process only the directories specified on the command line.
Don't process the trusted directories,
nor those specified in
<I>/etc/ld.so.conf</I>.
Implies
<B>-N</B>.
<DT id="7"><B>-N</B>
<DD>
Don't rebuild the cache.
Unless
<B>-X</B>
is also specified, links are still updated.
<DT id="8"><B>-p</B>, <B>--print-cache</B>
<DD>
Print the lists of directories and candidate libraries stored in
the current cache.
<DT id="9"><B>-r </B><I>root</I>
<DD>
Change to and use
<I>root</I>
as the root directory.
<DT id="10"><B>-v</B>, <B>--verbose</B>
<DD>
Verbose mode.
Print current version number, the name of each directory as it
is scanned, and any links that are created.
Overrides quiet mode.
<DT id="11"><B>-V</B>, <B>--version</B>
<DD>
Print program version.
<DT id="12"><B>-X</B>
<DD>
Don't update links.
Unless
<B>-N</B>
is also specified, the cache is still rebuilt.
</DL>
<A NAME="lbAF">&nbsp;</A>
<H2>FILES</H2>
<DL COMPACT>
<DT id="13"><I>/lib/ld.so</I>
<DD>
Run-time linker/loader.
<DT id="14"><I>/etc/ld.so.conf</I>
<DD>
File containing a list of directories, one per line,
in which to search for libraries.
<DT id="15"><I>/etc/ld.so.cache</I>
<DD>
File containing an ordered list of libraries found in the directories
specified in
<I>/etc/ld.so.conf</I>,
as well as those found in the trusted directories.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?1+ldd">ldd</A></B>(1),
<B><A HREF="/cgi-bin/man/man2html?8+ld.so">ld.so</A></B>(8)
<A NAME="lbAH">&nbsp;</A>
<H2>COLOPHON</H2>
This page is part of release 5.05 of the Linux
<I>man-pages</I>
project.
A description of the project,
information about reporting bugs,
and the latest version of this page,
can be found at
<A HREF="https://www.kernel.org/doc/man-pages/.">https://www.kernel.org/doc/man-pages/.</A>
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="16"><A HREF="#lbAB">NAME</A><DD>
<DT id="17"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="18"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="19"><A HREF="#lbAE">OPTIONS</A><DD>
<DT id="20"><A HREF="#lbAF">FILES</A><DD>
<DT id="21"><A HREF="#lbAG">SEE ALSO</A><DD>
<DT id="22"><A HREF="#lbAH">COLOPHON</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:06:13 GMT, March 31, 2021
</BODY>
</HTML>