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
  • 42,548
  • 23
  • 127
  • 221

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
  • 78,556
Requist
  • 2,389
  • 2
  • 22
  • 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 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
  • 84,289