LPIC-1 102.3: Shared libraries
Finding the libraries a program needs and the packages they came from, the three kinds of library name, and adding a directory to the linker's search path.
Before you start
The lab installs the SSH client if it's missing. Write answers to the
files in /root/lab-answers/.
Tasks
- Run
lddon/usr/bin/ls,/usr/bin/sshand/usr/bin/bash. Pick one library from each and find which package installed it. Write one line per program to/root/lab-answers/1: the program, the library and the package, such asls libselinux.so.1 libselinux. - Look at
ls -loflibc.so*andlibz.so*in your library directory and name each kind of name. Write zlib's soname on line 1 of/root/lab-answers/2, and its real name (the file the soname points to) on line 2. - Make an empty directory
/opt/test/lib, add it to a file in/etc/ld.so.conf.d/, runldconfig -v | grep /optand see it scanned. Then remove the file and runldconfigagain. Check it yourself:ldconfig -v 2>/dev/null | grep /optprints the directory while the file is there, and nothing after.
Hints
rpm -qf FILEon the RHEL family,dpkg -S FILEon Debian and Ubuntu. Ifdpkg -Sfinds nothing for a path under/lib, try it under/usr/lib(or the other way round).- The library directory is
/usr/lib64on the RHEL family and/usr/lib/x86_64-linux-gnuon Debian and Ubuntu;ldconfig -p | grep libz. - Real name
libz.so.1.3, sonamelibz.so.1, linker namelibz.so;readlink,objdump -p FILE | grep SONAME.