LPI 101 - Manage Shared Libraries (3) : (Linux Professional Institute Certification)
LPI 101 - Manage Shared Libraries (3) : (Linux Professional Institute Certification)
c 2002 Geoffrey Robertson, Andrew Eager. Permission is granted to make and distribute verbatim copies or modied versions of this document provided that this copyright notice and this permission notice are preserved on all copies under the terms of the GNU General Public License as published by the Free Software Foundationeither version 2 of the License or (at your option) any later version.
a Copyright
5-a
5-b
Relative Size
$ ls -l /bin/ln /sbin/sln -rwxr-xr-x 1 root root 23000 Jan 14 00:36 /bin/ln -rwxr-xr-x 1 root root 381072 Jan 14 00:31 /sbin/sln
6-a
7-a
7-b
8-a
8-b
ld.so.cache
Before the dynamic loader can see this information, it must be converted into an ld.so.cache le. This is done by running the ldcong command: $ ldconfig
When ldconfig completes, you now have an up-to-date /etc/ld.so.cache le that reects any changes youve made to /etc/ld.so.conf.
ldconfig tips
To view all the shared libraries that ldconfig can see, type: $ ldconfig -p | less
Sometimes, youll want to tell the dynamic loader to try to use shared libraries in a specic directory before trying any of your /etc/ld.so.conf paths. For older application requiring older libraries.
10
LD LIBRARY PATH
To instruct the dynamic loader to check a certain directory rst, set the LD LIBRARY PATH variable to the directories that you would like searched.
11
LD LIBRARY PATH
To instruct the dynamic loader to check a certain directory rst, set the LD LIBRARY PATH variable to the directories that you would like searched. Separate multiple paths using colons; for example: # export LD LIBRARY PATH="/usr/lib/old:/opt/lib"
11-a
LD LIBRARY PATH
To instruct the dynamic loader to check a certain directory rst, set the LD LIBRARY PATH variable to the directories that you would like searched. Separate multiple paths using colons; for example: # export LD LIBRARY PATH="/usr/lib/old:/opt/lib"
After LD LIBRARY PATH has been exported, any executables started from the current shell will use libraries in /usr/lib/old or /opt/lib if possible, falling back to the directories specied in /etc/ld.so.conf if some shared library dependencies are still unsatised.
11-b
Summary
ldd
12
Summary
ldd
Lists the required libraries
12-a
Summary
ldd
Lists the required libraries
ld.so.conf
12-b
Summary
ldd
Lists the required libraries
ld.so.conf
list of library paths
12-c
Summary
ldd
Lists the required libraries
ld.so.conf
list of library paths
ldconfig
12-d
Summary
ldd
Lists the required libraries
ld.so.conf
list of library paths
ldconfig
Updates /etc/ls.so.cache from ld.so.conf
12-e
Summary
ldd
Lists the required libraries
ld.so.conf
list of library paths
ldconfig
Updates /etc/ls.so.cache from ld.so.conf
LD LIBRARY PATH
12-f
Summary
ldd
Lists the required libraries
ld.so.conf
list of library paths
ldconfig
Updates /etc/ls.so.cache from ld.so.conf
LD LIBRARY PATH
Holds library path for current shell
12-g
The End Manage Shared Libraries . . . . . . . . . . . . . . . Introducing shared libraries . . . . . . . . . . . . . Static vs. Dynamic Executables . . . . . . . . . . . Dynamically Linked Dependencies . . . . . . . . . The dynamic loader . . . . . . . . . . . . . . . . . ld.so.cache . . . . . . . . . . . . . . . . . . . . . . ldconfig tips . . . . . . . . . . . . . . . . . . . LD LIBRARY PATH . . . . . . . . . . . . . . . . . Summary . . . . . . . . . . . . . . . . . . . . . . .
13
2 5 6 7 8 9 10 11 12