How to identify the dependencies of a package or binary file

Identifying the dependencies of a Linux package (DEB or RPM) or binary file can always be useful in avoiding errors when installing new applications or tools.

DEB packages

Repositories

In case the package is in the system repositories:

apt-cache depends PACKAGE

You can also do it from Synaptic. Look for the package, do right click> Properties> Dependencies.

To see the complete dependency tree (including the dependencies of the package's dependencies), install apt-rdepends. To see how it works, I recommend you read this another post.

DEB loose

To view the dependencies of a DEB package downloaded from the internet:

dpkg-deb -I mypackage.deb

Where mypackage.deb is the name of the package.

Note: to know the dependencies of the DEB packages, you can also access the databases of the repositories of your favorite distro. In the case of Ubuntu, I recommend you access the Ubuntu Package Database. For Debian, there is the Debian Package Database. The available packages and their dependencies are listed there.

RPM packages

Repositories

In the RPM world, things are very simple. If the package is in the repositories:

rpm -qR PACKAGE

Loose RPM

If it's a loose RPM package:

rpm -qpR PACKAGE
Note: to know the dependencies of the RPM packages, you can also access the databases of the repositories of your favorite distro. In the case of Fedora, I recommend you access the Fedora Package Database. The available packages and their dependencies are listed there.

Binary files

To discover the libraries used by a binary file in Linux, just type:

ldd binary_file

Where binary_file is the full name (including the path) of the binary in question.

In case those libraries, in turn, have dependencies and you want to see what they are, I wrote:

ldd -v binary_file
Thanks Rosgore for recommending us the topic!

Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   ivan80 said

    Excuse a question, what happens is that I need a driver for a xerox workcentre 5020 printer, I already downloaded it from xerox but it has some dependencies, the detail is that these dependencies are on my debian system but already updated, I tried to install that package but I It asks for more dependencies of that package and if I install the others, those others ask me for other dependencies and it becomes an eternity of dependencies that it can do, I hope you can help me, thanks in advance.

  2.   Gaius baltar said

    Have you tried the command 'apt-get build-dep package-name? I don't know if it requires this to be available in the repos, but to test ...

  3.   Adrian said

    I have read several tutorials on how to install programs by compiling, and it is the first time that I find out about this tip. With how useful it is.
    Thanks for sharing.

  4.   marcoshipe said

    I also see this for the first time for binaries, although generally when reading the readme's they tell you. I'm going to start implementing it and see what happens. Thanks for the information!!