Install RPM Packages Using Yum

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide
ft:sourceType
Paligo

After configuring the rpm-local repository in Artifactory, you need to configure your local machine to install software packages from it by executing the following steps:

  1. Edit the artifactory.repo file with root privileges

    sudo vi /etc/yum.repos.d/artifactory.repo
  2. Paste the following configuration into the artifactory.repo file:

    [Artifactory]
    name=Artifactory
    baseurl=http://localhost:8081/artifactory/rpm-local/
    enabled=1
    gpgcheck=0

Now, every RPM file deployed to the root of the rpm-local repository can be installed using:

yum install <package_name>

Managing Weak Dependencies in Yum/RPM with Recommends Tags

Note

This feature is supported from release version Artifactory 7.106.2 CloudArtifactory 7.106.2 Cloud

In RPM-based package management systems like Yum, packages can specify optional dependencies using the Recommends tag in their metadata. These dependencies are not required for the core functionality of the package but are recommended for enhanced performance or features. By default, the yum client installs these recommended dependencies automatically when installing a package, unless explicitly disabled.

You can manage how Yum handles weak (recommended) dependencies by configuring the Recommends tags in the primary.xml metadata of RPM repositories.

Set Artifactory System Properties - Self-hosted: Enabling/Disabling Recommends TagsArtifactory System Properties

The inclusion of Recommends tags in primary.xml is now configurable via artifactory system properties artifactory.yum.local.install.recommended.dependencies.enabled=true

When enabled, Yum will install any recommended dependencies listed in the primary.xml metadata of RPM local repositories. When disabled, the recommends xml tag is not added to repository metadata.

Note

By default, artifactory.yum.local.install.recommended.dependencies.enabled property is disabled.

Note

Implications on Data Transfer: Enabling this feature on the Artifactory server side will increase 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.

Default Behavior for Installing Recommended Dependencies

When you install a package with Yum, it will by default install any weak dependencies (i.e., recommended packages) listed for that package. For example:

yum install -y simple-package

This command will install the simple package and any recommended packages that are listed as dependencies.

Preventing Installation of Weak Dependencies

If you want to install a package without its weak dependencies (without installing recommended packages), 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 same settings and methods apply to dnf, which is the newer package manager for RPM-based systems. You can use similar commands and configuration options to manage weak dependencies with dnf. For instance, you can use the --setopt flag, and adjust settings in configuration files located in /etc/dnf/, just like you would with Yum.