You are currently viewing Troubleshoot library dependency issues on Linux

Troubleshoot library dependency issues on Linux

  • Post author:
  • Post category:RedHat

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.

  1. 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
  2. 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
  3. To resolve, find out which packages provide libpcap:
    [root@app ~]# dnf whatprovides /libcap.so*
  4. Reinstall libpcap:
    [root@app ~]# dnf reinstall -y libcap