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.
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
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
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.
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 ...
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.
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!!