14

In this answer, I came across this command:

aptitude why firefox

aptitude whylooks like an useful command but I don't want to install aptitude just for that. What is the apt-get equivalent of aptitude why?

DK Bose
  • 41,240
  • 22
  • 121
  • 214

2 Answers2

12

Instead of apt-get I would have a look at apt-cache, though not one on one the same but close will be:

apt-cache --installed rdepends firefox
Avinash Raj
  • 77,204
  • 56
  • 214
  • 254
Requist
  • 2,359
  • 2
  • 20
  • 32
  • 1
    This is not right answer. There is no similar for `aptitude why` – Maythux Feb 21 '14 at 12:28
  • Thanks! I mentioned apt-get but apt-cache will do just as well because it is installed by default. I should have made my question clear on this point! – DK Bose Feb 21 '14 at 12:29
  • 1
    Even though these two commands are not the same – Maythux Feb 21 '14 at 12:32
  • 1
    @maythux, as mentioned in my answer. But it comes close and gives reverse dependencies so it is useful for most users who ask this, so why not mention it? – Requist Feb 21 '14 at 12:34
  • The command aptitude why firefox gives i firefox-gnome-support Depends firefox The command apt-cache --installed rdepends firefox gives: firefox Reverse Depends: |rhythmbox-mozilla firefox-gnome-support flashplugin-installer xul-ext-ubufox xul-ext-ubufox ubuntu-desktop |totem-mozilla |rhythmbox-mozilla flashplugin-installer xul-ext-ubufox xul-ext-ubufox ubuntu-desktop |totem-mozilla |rhythmbox-mozilla hunspell-en-us hunspell-en-ca firefox-gnome-support – Maythux Feb 21 '14 at 12:35
  • Yes, the difference is in what reverse dependency was manually installed versus what reverse dependency is installed. – Requist Feb 21 '14 at 13:04
  • 2
    As suggested [here](http://askubuntu.com/questions/5636/can-i-see-why-a-package-is-installed#comment505140_5637) there is a bunch of other options you might want to add; `apt-cache rdepends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances --installed --recurse $package` – tripleee Jun 29 '15 at 05:10
4

People might want to know why an automatically installed package is present on the system. To get this information from the command line, you can use aptitude why package

apt-get has no similar feature

source:debian-handbook

Maythux
  • 82,867
  • 54
  • 239
  • 271