Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

In order to research what caused the installation of a given package, I'd like to get a list of packages which depend on that package. I couldn't find anything obvious in man dpkg.

share|improve this question

marked as duplicate by bodhi.zazen, hbdgaf, Eric Carvalho, Eliah Kagan, Tim Aug 12 at 7:47

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

4 Answers 4

up vote 34 down vote accepted

apt-cache rdepends packagename should do what you want

share|improve this answer
1  
Excellent! apt-cache rdepends tofrodos confirmed the suspicion that it was installed by another package (the obsoleted dos2unix). –  l0b0 Apr 30 '12 at 13:12
    
Good deal. I do wish there was a recursive option. Sadly there is not as far as I am aware. –  hbdgaf Apr 30 '12 at 13:27
1  
As for today (apt version 0.9.9.1), there is --recurse option that works with rdepends. –  jarno Dec 22 '13 at 14:00
    
Thanks for the heads up. /me is even more pleased than he was. –  hbdgaf Dec 22 '13 at 22:50
    
@l0b0: btw, if you only needed to know if a package was installed automatically as a dependency - there is apt-mark showauto available –  zerkms Feb 3 at 21:24

aptitude has a fairly nice way of handling this:

$ aptitude why bash
i   foomatic-filters PreDepends bash (>= 2.05)

It only lists one reason, but that's usually enough...

share|improve this answer
    
Seems like it considers only the installed packages, not everything available. And that was what I needed. –  Tuukka Mustonen Jul 25 '13 at 10:06
    
For that you want reverse-depends in ubuntu-dev-tools –  tumbleweed Jul 25 '13 at 11:38
    
How about debian? –  Tuukka Mustonen Jul 25 '13 at 12:08
    
ubuntu-dev-tools is in Debian –  tumbleweed Jul 26 '13 at 11:18

There are more than one way, with each method showing a different output.

For a detailed view of the dependency tree; aptitude install apt-rdepends apt-rdepends bash

Alternatively;

apt-cache showpkg bash

Or a concise list:

apt-cache rdepends bash

share|improve this answer
apt-cache showpkg <pkgname> 

Example:

apt-cache showpkg lightdm
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.