Find absolute path for shared dependencies

Find absolute path for shared dependencies

I am new to Linux and I am trying to find the absolute path for the dependencies that are listed in one of the following commands' output.

  • apt-cache showpkg "package name"
  • apt-cache depends "package name"

These commands give the list of dependencies on which the package depends on but not the path for that dependency which we can use in ldd to further check the shared dependencies for that package.

My question is how can I find where these libraries are present in the entire system. I am using Ubuntu 16.04. For some reason, I have to find the further shared dependencies for the list of dependencies provided in apt-cache showpkg command output. Any help will be highly appreciated.

For example, apt-cache depends lighttpd outputs

lighttpd
  Depends: libattr1
  Depends: libbz2-1.0
  Depends: libc6
 |Depends: libgamin0
  Depends: libfam0
    libgamin0
  Depends: libldap-2.4-2
  Depends: libpcre3
  Depends: libssl1.0.0
  Depends: zlib1g
  Depends: init-system-helpers
  Depends: perl
 |Depends: lsb-base
  Depends: systemd
    systemd:i386
  Depends: mime-support
  Depends: libterm-readline-perl-perl
  Recommends: spawn-fcgi
  Suggests: openssl
  Suggests: rrdtool
  Suggests: apache2-utils
    apache2-utils:i386
  Suggests: ufw 

I want to find the shared dependencies for libattr1, libgamin0 and so on.

答案1

Debian-style dependencies don’t concern themselves with actual paths, just with package names.

To see the full dependency tree of lighttpd, use the --recurse flag:

apt-cache depends --recurse lighttpd

This will show lighttpd’s immediate dependencies, then for each dependency it hasn’t analysed yet, that dependency’s immediate dependencies, and so on until every single dependency has been analysed once.

To see the actual paths involved, use dpkg -L if the package is already installed, apt-file list otherwise.

相关内容