0

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"

After executing the above commands I get a list of dependences for the package 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 present in the entire system. I am using Ubuntu 16.4. 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 and Thank you in advance.

E.g.:

apt-cache depends lighttpd
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
Fabby
  • 34,259
Vidhi
  • 53
  • locate package works perfectly in this situation but I am looking for something with already inbuild commands such as which or find. – Vidhi Jan 11 '18 at 09:42

1 Answers1

0

Sorry for the late answer, going over old unanswered migrated questions: Let's go a bit deeper on package dependencies and file locations:

A package is a inventory of collections of files (like a Table of Contents (TOC) in a book) whereas file locations are pointers to where a file resides on disk.

However, you can have the TOC, without the book(Packages without files), and you can have files without Package dependencies (E.g. a standalone script)

So if you'd only be interested in knowing the file location for the packages that are installed on the system, you'd have to do a:

  • List all packages
  • Get a list of files in those packages
  • and then use locate --existing to run that list through locate (fastest, find will take much longer) and you have what you need!
  • knowing that you might still have files without a package and packages without files (meta-packages)
Fabby
  • 34,259