RPM based package managers support subcommands such as requires, recommends, conflicts, obsoletes, suggests and supplements.

In reading the rpm man pages and dependencies documentation, it isn't clear how these differ.

For example, if i run the command rpm --query --info MozillaFirefox, the following output is returned.

Name        : MozillaFirefox
Version     : 60.4.0
Release     : lp150.3.30.1
Architecture: x86_64
Install Date: Sun 06 Jan 2019 07:43:50 AM NZDT
Group       : Productivity/Networking/Web/Browsers
Size        : 161608776
License     : MPL-2.0
Signature   : RSA/SHA256, Thu 13 Dec 2018 08:35:09 PM NZDT, Key ID b88b2fd43dbdc284
Source RPM  : MozillaFirefox-60.4.0-lp150.3.30.1.src.rpm
Build Date  : Wed 12 Dec 2018 10:35:10 PM NZDT
Build Host  : cloud138
Relocations : (not relocatable)
Packager    : http://bugs.opensuse.org
Vendor      : openSUSE
URL         : http://www.mozilla.org/
Summary     : Mozilla Firefox Web Browser
Description :
Mozilla Firefox is a standalone web browser, designed for standards
compliance and performance.  Its functionality can be enhanced via a
plethora of extensions.

If i run the command rpm --query --recommends MozillaFirefox, the following output is returned.

libavcodec-full >= 0.10.16

I assume that libpulse0 refers to the PulseAudio package. If yes, the command rpm --query --info pulseaudio returns

Name        : pulseaudio
Version     : 11.1
Release     : lp150.4.1
Architecture: x86_64
Install Date: Sun 06 Jan 2019 06:49:12 AM NZDT
Group       : System/Sound Daemons
Size        : 3605819
License     : GPL-2.0+ AND LGPL-2.1+
Signature   : RSA/SHA256, Mon 23 Apr 2018 10:39:20 AM NZST, Key ID b88b2fd43dbdc284
Source RPM  : pulseaudio-11.1-lp150.4.1.src.rpm
Build Date  : Mon 23 Apr 2018 10:38:51 AM NZST
Build Host  : build70
Relocations : (not relocatable)
Packager    : https://bugs.opensuse.org
Vendor      : openSUSE
URL         : http://pulseaudio.org
Summary     : A Networked Sound Server
Description :
pulseaudio is a networked sound server for Linux, other Unix like
operating systems and Microsoft Windows. It is intended to be an
improved drop-in replacement for the Enlightened Sound Daemon (ESOUND).

If the pulseaudio package is already installed, why is there a recommendation to install libpulse0?

  • What do recommends, conflicts, obsoletes, suggests and supplements refer to?
  • What is the difference between recommends, suggests and supplements?
  • When should they be used?
rpm --query --recommends MozillaFirefox

lists the packages which the MozillaFirefox package recommends (I’ll explain that further down). As with most things interpreted by a computer, the output is to be taken literally; so the libpulse0 recommendation concerns the libpulse0 package, not the pulseaudio package.

The list of packages is static, and shown as defined in the MozillaFirefox package; it doesn’t take into account packages which are already installed on your system.

The package relationships are as follows:

  • requires: package A requires on package B if it needs package B to function;
  • recommends: package A recommends package B if it can use package B, and most users would use the two packages together (this is known as a weak dependency);
  • suggests: package A suggests package B if it can use package B, but most users wouldn’t need it (this is known as a very weak dependency);
  • supplements: package A supplements package B if it adds functionality to package B, and most users would use the two packages together (it’s pretty much symmetric with “recommends”);
  • enhances: package A enhances package B if it adds functionality to package B, but most users wouldn’t find it particularly useful (it’s pretty much symmetric with “suggests”).

This should help you understand what these terms refer to, what the differences between them are, and when they should be used.

Whether the relationships are actually taken into account depends on the package management tool being used. rpm itself deals with individual packages, so only strong dependencies matter to it (“requires”). As far as I’m aware, yum also only takes strong dependencies into account. dnf is configured to install weak dependencies by default; see the install_weak_deps flag in dnf.conf. Zypper and urpm can also be configured to consider weak dependencies.

One added subtlety is the difference between the recommends/suggests and supplements/enhances pair, i.e. why we need both. They represent knowledge which is available in different places. For example, a package which can optionally use a library “knows” that it can do so; the appropriate relationship then is “recommends” or “suggests”. However, a package such as Firefox can’t possibly know all its plugins, so it doesn’t attempt to list all available plugins in “recommends” or “suggests”; each individual plugin can indicate that it adds functionality to Firefox by indicating that it “supplements” or “enhances” it in its RPM specification.

See the RPM documentation for details.

  • Thanks for the explanation and that's clearer. A couple of clarifications. At what point does recommends, suggests, supplements and enhance occur? For example, are these provided at the point of installation or is it an explicit query that a user has to run e.g. rpm --query --recommends MozillaFirefox. Secondly, what does "each individual plugin indicates that it adds functionality" mean? How does a plugin indicate? – Motivated Jan 16 at 6:02
  • Additionally, what is the relationship with provides? – Motivated Jan 16 at 6:11
  • See the update regarding the questions in your first comment. provides in the RPM world are quite complex, that should really be a separate question. – Stephen Kitt Jan 17 at 10:19
  • Thanks for the additional context. If zypper, urpm and dnf can be configured to consider weak dependencies, it would suggest that they are not be default. If yes, does that mean that if i wanted to consider --recommends for example, i would have to either configure the package manager or alternatively run commands such as zypper info --recommends MozillaFirefox. Would that be correct? Additionally, is there any benefit to configuring package manager to consider weak dependencies or is it simply a case of user preference? – Motivated Jan 17 at 16:11
  • As I mentioned in my update, dnf is configured to consider weak dependencies by default. I don’t know what the defaults for Zypper and urpmi are. – Stephen Kitt Jan 17 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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