Red Hat Enterprise Linux Diagnostics and Troubleshooting
Install third-party software and resolve library dependencies.
Outcomes
You should be able to identify which libraries an application requires to run on a system.
As the student user on the workstation machine, use the lab command to prepare your system for this exercise.
[student@workstation ~]$ lab start application-dependencies
This command confirms that the required hosts for this exercise are accessible and installs the application package.
Instructions
Another system administrator installed the genisoimage application and cannot run it. You are asked to solve the issue.
Log in as
studentonservera. Attempt to execute the newly installed program, and observe how it behaves. An error message is displayed. The program generates the same error message when failing to resolve a library as when the shell cannot locate a command.[student@workstation ~]$
ssh student@servera...output omitted... [student@servera ~]$genisoimagegenisoimage: error while loading shared libraries: libusal.so.0: cannot open shared object file: No such file or directory [student@servera ~]$echo $?127Determine which shared libraries the program requires. The error message states that
libusal.so.0is required, but that other required libraries might also be missing. All but two libraries are resolved:libusal.so.0andlibrols.so.0.[student@servera ~]$
which genisoimage/usr/bin/genisoimage [student@servera ~]$ldd /usr/bin/genisoimagelinux-vdso.so.1 (0x00007ffe333e9000) libmagic.so.1 => /lib64/libmagic.so.1 (0x00007fab7d738000) libc.so.6 => /lib64/libc.so.6 (0x00007fab7d373000) libz.so.1 => /lib64/libz.so.1 (0x00007fab7d15c000) libbz2.so.1 => /lib64/libbz2.so.1 (0x00007fab7cf4b000) libusal.so.0 => not found librols.so.0 => not found ...output omitted...Locate the packages that provide those two libraries.
[student@servera ~]$
yum provides libusal.so.0libusal-1.1.11-39.el8.i686 : Library to communicate with SCSI devices Repo : rhel-8.4-for-x86_64-appstream-rpms Matched from: Provide : libusal.so.0 [student@servera ~]$yum provides librols.so.0libusal-1.1.11-39.el8.i686 : Library to communicate with SCSI devices Repo : rhel-8.4-for-x86_64-appstream-rpms Matched from: Provide : librols.so.0The
libusalpackage provides both libraries. Use thesudocommand to runyumto install it. Usestudentas the password if prompted.[student@servera ~]$
sudo yum install libusal[sudo] password for student:student...output omitted...As the
studentuser, attempt to run the original program again.The executable appears to run, but displays a new message because of invalid arguments.
[student@servera ~]$
genisoimagegenisoimage: Missing pathspec. Usage: genisoimage [options] -o file directory ... Use genisoimage -help to get a list of valid options. Report problems to debburn-devel@lists.alioth.debian.org.Red Hat Enterprise Linux provides a package that includes a
genisoimagecommand. Use theyumcommand to locate which RPM provides it and inspect it locally.[student@servera ~]$
yum provides '*bin/genisoimage'genisoimage-1.1.11-39.el8.x86_64 : Creates an image of an ISO9660 file-system Repo : rhel-8.4-for-x86_64-appstream-rpms Matched from: Other : *bin/genisoimageUse the
`--downloadonlyoption to download the package into your home directory, without installing it. If prompted, usestudentas the password.[student@servera ~]$
sudo yum reinstall genisoimage --downloadonly --destdir /home/student/[sudo] password for student:student...output omitted... Downloading Packages: genisoimage-1.1.11-39.el8.x86_64.rpm 60 MB/s | 316 kB 00:00 -------------------------------------------------------------------------------- Total 31 MB/s | 316 kB 00:00 Complete! The downloaded packages were saved in cache until the next successful transaction. You can remove cached packages by executing 'yum clean packages'.Using RPM package management simplifies system administration. The library dependency would have been detected when the software was originally installed. Runtime libraries are identified and stored in the package metadata when a package is built.
[student@servera ~]$
rpm -q --requires -p genisoimage-*.rpm...output omitted... libbz2.so.1()(64bit) libc.so.6()(64bit) libc.so.6(GLIBC_2.14)(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3)(64bit) libc.so.6(GLIBC_2.3.2)(64bit) libc.so.6(GLIBC_2.3.4)(64bit) libc.so.6(GLIBC_2.4)(64bit) libc.so.6(GLIBC_2.7)(64bit) libmagic.so.1()(64bit) libpthread.so.0()(64bit) libpthread.so.0(GLIBC_2.2.5)(64bit) librols.so.0()(64bit) libusal = 1.1.11-39.el8 libusal.so.0()(64bit) libz.so.1()(64bit) ...output omitted...Optional: Remove the package that provides the needed libraries.
Remove the
libusalpackage. When prompted, usestudentas the password.[student@servera ~]$
sudo rpm -e $(rpm -qa | grep libusal) --nodeps[sudo] password for student:studentAttempt to execute the application. The program fails to run again. If a package provides the application, then use the
rpmandyumcommands to display the missing library dependencies.[student@servera ~]$
genisoimagegenisoimage: error while loading shared libraries: libusal.so.0: cannot open shared object file: No such file or directory
Return to
workstationas thestudentuser.[student@servera ~]$
exit[student@workstation ~]$