Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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

I've checked the man/info page, but there is no reference to some aspects of the output fomat of apt-cache depends

The man/info page tried to be helpful (in an obtuse manner); quote: "For the specific meaning of the remainder of the output it is best to consult the apt source code"

Now in fairness to the info page, that quote was in regards to the 'showpkg' option which it had reasonably explained, but my option had no such explanation... I understand that Linux info comes from many sources (not just man/info pages), and I don't particularly want to rummage through the source (altough somtimes I do), so here is an example of what I'd like to know the meaning of.

# I can assume what these mean, but... 
#  What does | mean? (probably means 'or'???)
#  What does <pkg> and the following indentations  mean? 
#  At the end, the interaction(?) of Suggest and Recommends puzzles me.

$ apt-cache depends solr-common
  Depends: debconf
 |Depends: openjdk-6-jre-headless
 |Depends: <java5-runtime-headless>
  Depends: <java6-runtime-headless>
  Depends: libcommons-codec-java
  Depends: libcommons-csv-java
  Depends: libcommons-fileupload-java
  Depends: libcommons-httpclient-java
  Depends: libcommons-io-java
  Depends: libjaxp1.3-java
  Depends: libjetty-java
  Depends: liblucene2-java
  Depends: libservlet2.5-java
  Depends: libslf4j-java
  Depends: libxml-commons-external-java
  Suggests: libmysql-java
 |Recommends: solr-tomcat
  Recommends: solr-jetty
share|improve this question
up vote 12 down vote accepted

The authoritative reference is the Debian policy manual:

Quoting the manual:

The Recommends field should list packages that would be found together with this one in all but unusual installations.

Suggests: This is used to declare that one package may be more useful with one or more others. Using this field tells the packaging system and the user that the listed packages are related to this one and can perhaps enhance its usefulness, but that installing this one without them is perfectly reasonable.

These days packages that are recommended are installed as well by default ( when you install the package doing the recommending ).

As you guessed the | indicates "or". The control line normally shows foo | bar, but apt-cache depends appears to reformat it by showing each alternative on its own line and prefixing the first with the |. In other words, the pipe flags the preferred option and the next line is the alternative.

The package listed in angle brackets indicates that it is a virtual package. The packages listed on the indented lines after it are the various packages that provide that service.

share|improve this answer
Thanks psusi. That has certainly put me on the right track.. The difference between Recommends and Suggests is still a bit vague to me, but I'm sure that now I'm aware of approximately what they mean, I'll gradually 'get' it by exposure to some examples where I already have a feel for what and why something is being Suggested or Recommended. – Peter.O Feb 9 '11 at 2:41
Recommends are now installed by default and suggests are not. That is the main difference in practice. Essentially, recommends allow you to "depend" on something but allow the user to still uninstall it without uninstalling your packages. Suggests merely show up in some UIs as something you might also want to install. The use case is something like file-roller (the archive manager) suggesting a more exotic compression lib that it could use if installed but most people don't want. – andrewsomething Feb 9 '11 at 4:59
@fred.bear a good example is a music program like audacity. If you want to rip cds, you need to install cdparanoia. If you want to encode/play mp3s, then you need to install lame. You can still run audacity without these, but most people who run it expect it to be able to rip cds to mp3, so those packages should be recommended. It can also encode to FLAC, but that makes a better candidate for suggests since most people don't use FLAC. – psusi Feb 9 '11 at 14:54
@andrewsomething and @psusi... a couple of nice extas... thanks – Peter.O Feb 10 '11 at 5:24

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.