24

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
0

1 Answer 1

18

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.

4
  • 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, 2011 at 2:41
  • 2
    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. Feb 9, 2011 at 4:59
  • 3
    @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, 2011 at 14:54
  • @andrewsomething and @psusi... a couple of nice extas... thanks
    – Peter.O
    Feb 10, 2011 at 5:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .