This question is similar to How can I find out why a package was installed?, but in my case I'd like to know before actually installing a package, why it will install a particular dependency.
So for example I might run
sudo apt-get install superfoo
and the output will say something like:
The following extra packages will be installed:
foo bar baz ... libderp libjunk
And this might be a really huge list. In some instances I'll see something that is going to be installed that doesn't really make sense to me given what I'm installing, so I want to know why that particular dependency is going to be installed.
In the above example let's say I'd like to understand why libderp
would get installed. I know that somehow there is a chain of dependencies between superfoo
and libderp
but the huge list of packages to be installed makes it hard to see what this chain is.
Once I know the dependency chain, I can decide whether I really want to install the original package or not, and/or whether I should get in touch with the maintainer of that package to see if they really need to have those dependencies there.