Ubuntu – In ‘apt-cache depends’ output, what is the meaning of Suggests, Recommends, |, <>

aptapt-cachedocumentationinfomanpage

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
solr-common    
  Depends: debconf
 |Depends: openjdk-6-jre-headless
 |Depends: <java5-runtime-headless>
    default-jre-headless
    gcj-4.4-jre-headless
    gcj-jre-headless
    gij-4.3
   openjdk-6-jre-headless
  Depends: <java6-runtime-headless>
    default-jre-headless
    openjdk-6-jre-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

Best Answer

The authoritative reference is the Debian policy manual: http://www.debian.org/doc/debian-policy/

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.