Ubuntu – Can I see why a package is installed

aptdependenciessoftware installation

For a specific package, can I find out why it is installed?

So, can I see or it's manually installed, or that it is installed as a dependency of another package? Or that it is installed as part of the distro?

Best Answer

  • A quick solution is to enter the following command in a terminal:

    aptitude why $package

    or, if you are only interested in the ultimate cause:

    aptitude why $package --show-summary

    Replace $package with the package's name, and you may need to install the aptitude package first.

    Here is output you might get for aptitude why aspell --show-summary

    Packages requiring aspell:

    For more detail you would run aptitude why aspell. You can read the example output, below, as follows: "You manually installed inkscape, which requires libgtkspell, which requires libenchantic2a, which requires aspell". (i markers indicate installed packages; A markers indicate automatically installed packages.)

    i   inkscape       Depends libgtkspell0 (>= 2.0.10)                                                                    
    i A libgtkspell0   Depends libenchant1c2a (>= 1.6.0)                                                                   
    i A libenchant1c2a Depends aspell-en | myspell-dictionary | aspell-dictionary | ispell-dictionary | hunspell-dictionary
    i A aspell-en      Depends aspell (>= 0.60.3-2)

    Finally, the following command

    apt-cache rdepends --installed $package

    lists the other packages installed on your computer that depend directly on $package. You can add the --recurse option to list all packages that depend directly or indirectly on it.

  • Related Question