Manage Weak Dependencies in YUM/RPM with Recommends Tags

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide

Note

This configuration is supported from Artifactory 7.106.2 Cloud and 7.125.x Self-Managed.

In RPM-based package management systems like YUM, packages can specify optional dependencies using the Recommends tag in their metadata. Recommended dependencies are also called weak dependencies. Weak dependencies are not required for the core functionality of the package but are recommended for enhanced performance or features.

When you install a package with yum, weak dependencies listed for that package are installed by default. For example, the command yum install -y simple-package installs both simple-package and recommended packages listed as dependencies. This is the default behavior unless explicitly disabled.

Note

Implications on Data Transfer: Enabling Recommends tags on the Artifactory server side increases data transfer since the default flow of the client is to install soft dependencies by default. This means that clients will pull additional packages for every installation that has recommended dependencies.

Enable and Disable Recommends Tags

You can manage how YUM handles weak dependencies by configuring the Recommends tags in the primary.xml metadata of RPM repositories. When Recommends tags are enabled, the yum client downloads weak dependencies alongside the package. When the tags are disabled, only the specified package is downloaded.

To configure Recommends tags:

  1. In the Administration module, click Artifactory Settings > Packages Settings.

  2. In the RMP section, select or clear the Enable Recommends tags checkbox.

    When the checkbox is selected, Artifactory adds the Recommends tag in Yum metadata.

  3. Click Save.

Preventing Installation of Weak Dependencies

If you want to install a package without its weak dependencies, you can disable this behavior in one of the following ways:

  • Disable via Command Line

    To prevent installing recommended packages when installing a package, use the --setopt=install_weak_deps=False flag in the yum command. For example:

    yum --setopt=install_weak_deps=False install -y simple-package

    This command installs simple-package but skips the installation of any recommended dependencies.

  • Disable via Configuration File

    You can permanently configure yum to skip weak dependencies by modifying its configuration. There are two main ways to do this:

    • Modify the Main yum Configuration File (/etc/yum.conf):

      Open the Yum configuration file and add the following setting under the [main] section:

      [main]
      install_weak_deps=False

      This change will apply to all Yum operations globally.

    • Create a Custom Configuration File in /etc/yum/yum.conf.d/:

      Alternatively, you can create a specific configuration file in the /etc/yum/yum.conf.d/ directory to disable weak dependencies for specific use cases. For example, create a new file called disable-weak-deps.conf:

      /etc/yum/yum.conf.d/disable-weak-deps.conf

      Then, add the following configuration in the disable-weak-deps.conf file.

      [main]
      install_weak_deps=False

      This allows you to keep different configurations in separate files for different scenarios or environments.

Important

The information and procedures on this page also apply to dnf, the newer package manager for RPM-based systems.