257 104 71KB
English Pages [2] Year 2020
BASH SCRIPT EXERCISE HOW TO CHECK DEPENDANCIES FOR ANY PACKAGE Dependencies of any package can be checked in many different ways. Hence, this document describes the easiest way by using ldd ( a bash script – from glibc or libc package.) which in turn uses linker library ld-linux.so which is again a part of glibc or libc6. First we check dependencies of an installed package, then we gonna check dependencies of an uninstalled package
Gerda - The Snow Queen REMEMBER : YOU CAN CHECK DEPENDENCIES OF ONLY DYNEMICALLY LINKED (SHARED) OBJECTS LIKE ELF EXECUATABLES OR A LIBRARIES LIKE lib.so ldd does not check dependencies of static objects as well as scripts such as bashscript. You have to go manually and figure-out the commands used in a script, or, simply write a bashscript wich can walk through given script and finds-out the commands used in a particular script. 1) ldd -help → check what options are available. $> ldd --help Usage: ldd [OPTION]... FILE... --help print this help and exit --version print version information and exit -d, --data-relocs process data relocations -r, --function-relocs process data and function relocations -u, --unused print unused direct dependencies -v, --verbose print all information For bug reporting instructions, please see: . Most of the time, --help is very informative. For more details, go through the man pages man For usage examples you an always search the web. If you still want to know more, read, LINUX IN A NUTSHELL by Ellen Siever, Stephen Figgins, Robert Love, and Arnold Robbins Someone recommended it, which is indeed very informative.
2) Checking dependencies of ls $> ldd /bin/ls linux-vdso.so.1 => (0x00007fffe0dfe000) , OR, linux-gate.so.1 → linux-vdso and linux-gate.so are physically non-existent libraries. librt.so.1 => /lib/librt.so.1 (0x00002b4eca08e000) libacl.so.1 => /lib/libacl.so.1 (0x00002b4eca297000) libc.so.6 => /lib/libc.so.6 (0x00002b4eca49f000) libpthread.so.0 => /lib/libpthread.so.0 (0x00002b4eca7df000) /lib64/ld-linux-x86-64.so.2 (0x00002b4ec9e72000) libattr.so.1 => /lib/libattr.so.1 (0x00002b4eca9fa000) 3) Checking dependencies of a package which is not installed in a system. For example: mlocate_xxx.deb ar x mlocate-xxx.deb