Software applications, services, and other programs often require access to certain functions in order to work properly. These functions are typically grouped into libraries, which are then loaded into memory and used across multiple pieces of software in a dynamic way. We will identify which library dependencies are being used, as well as how to fix any issues when they’re missing or corrupted.
- Issue: Attempting to packet capture using tcpdump command
[root@app ~]# tcpdump -c 10 -i eth0
Which returns the following library error:
tcpdump: error while loading shared libraries: libpcap.so.1: cannot open shared object file: No such file or directory - Now lookup for the Libraries. Use which tcpdump to look up the libpcap library:
[root@app ~]# ldd $(which tcpdump) | grep libpcap
libpcap.so.1 => not found
libpcap.so is not found - To resolve, find out which packages provide libpcap:
[root@app ~]# dnf whatprovides /libcap.so* - Reinstall libpcap:
[root@app ~]# dnf reinstall -y libcap