Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The Synaptic Package Manager has a custom filter "Missing Recommends". Is there a way to find out which packages installed on my system recommended the packages listed in this filter?

share|improve this question

As far as I know there is no easy way to find out which package recommends a specific other package.

Here is a crude script to build a list of what package recommends or suggests what other package:

dpkg --get-selections | cut -f 1 | while read pkgname
  apt-cache depends "$pkgname" | \
  grep -E "Recommends|Suggests" | \
  cut -b 3- | \
  while read recommends
    echo "$pkgname" "$recommends"
done | sort -k 3 -k 2 | column -t

Note: the script takes some to run. Also the output is very long so you very likely want to capture the output in a file:

$ > whatrecommends.txt

Sample of output:

ubuntu-desktop                    Recommends:  avahi-autoipd
avahi-daemon                      Suggests:    avahi-autoipd
dhcp3-client                      Suggests:    avahi-autoipd
libnss-mdns                       Suggests:    avahi-autoipd
hplip                             Recommends:  avahi-daemon
rhythmbox                         Recommends:  avahi-daemon
ubuntu-desktop                    Recommends:  avahi-daemon
libsane                           Suggests:    avahi-daemon
pulseaudio-utils                  Suggests:    avahi-daemon
sane-utils                        Suggests:    avahi-daemon
system-config-printer-common      Recommends:  avahi-utils
bash                              Recommends:  bash-completion
ubuntu-standard                   Recommends:  bash-completion
ack-grep                          Suggests:    bash-completion
bash                              Suggests:    bash-doc

By changing the parameters of sort at the end of the script you can change the sort order of the output.

share|improve this answer

Aptitude can perform some fairly fancy searches

This will show all the packages that have a Recommends that isn't satisfied:

aptitude search '?installed?broken-recommends'

To restrict it to a specific recommended package:

aptitude search '?installed?broken-recommends(PACKAGE)'
share|improve this answer
This is indeed a step in the right direction, however it would be superb if it would also list which recommends were missing for each package. But I will check into this this weekend and see if I manage to create something usefull with this. – Zombaya Apr 12 '13 at 14:40

Based on tumbleweed's answer, I made a script that uses aptitude searches to come up with the packages which recommend a missing package.

It however doesn't give the same, complete list as synaptic. No idea why.

The script


$list = shell_exec("aptitude search '?broken-reverse-recommends(?installed)'");
preg_match_all("|^.{4}(.*) - (.*)$|mU", $list, $matches);

foreach ($matches[1] as $prog) {
    $prog = trim($prog);
    echo "$prog:\n";
    $missing = shell_exec("aptitude search '?installed?broken-recommends($prog)'");
    preg_match_all("|^.{4}(.*) - (.*)$|mU", $missing, $mismatch);
    foreach ($mismatch[1] as $missoft) {
        echo "\tRecommended by: ".trim($missoft)."\n";

Sample output

    Recommended by: adduser
    Recommended by: xubuntu-desktop
    Recommended by: xul-ext-ubufox
    Recommended by: xubuntu-desktop
    Recommended by: iproute
share|improve this answer

Here, my way - report for missing recommends :)

apt-cache --no-pre-depends --no-depends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances depends `dpkg --get-selections | grep '\sinstall$' | cut -f1` | grep -vf <(dpkg --get-selections | grep '\sinstall$' | cut -f1 | sed -e 's/^/ /' -e 's/\(:.*\|\)$/$/') | grep -B1 '^ '
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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