What is the resolution order of YUM client for RPM repositories?

Nimer Bsoul
2021-08-31 09:04

Subject

The Yellowdog Updater, Modified (YUM) is a libre and open-source command-line package-management utility for computers running the GNU/Linux operating system using the RPM Package Manager.
Artifactory remote repositories support RPMs out-of-the-box, and there no need for any special configuration needed in order to work with RPMs in a remote repository. All you need to do is point your YUM client at the remote repository, and you are ready to use YUM with Artifactory.

Affected Versions

All Artifactory versions that support RPM repositories.

Details

The configuration file for YUM client and it's related utilities are located at /etc/yum.conf. This file contains one mandatory [main] section, which allows you to set YUM options that have global effect, and can also contain one or more [repository] sections, which allows you to set repository-specific options.
It is recommended to define individual repositories in new or existing .repo files in the /etc/yum.repos.d/ directory.
The values you define in individual [repository] sections of the /etc/yum.conf file override values set in the [main] section.
Let's say you have multiple repositories under /etc/yum.repos.d/such asartifactory.confthe YUM client will resolve the packages starting by an alphabetical resolution order.
To check the order of repositories, you can run the command$ sudo yum repolist allto get the repositories order and if they are enabled or disabled.
If you would like to disable one of the repositories to not be as package source which is configured as part of <name>.repo , you can edit the directive named enabled and set it to 0.

Example of a yum.conf file:
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True
best=True
ip_resolve=4

Example of Artifactory as a repository source for YUM client (artifactory.repo):
[Artifactory]
name=Artifactory
baseurl=http://<ARTIFACTORY_URL>/rpm/<PATH_TO_REPODATA_FOLDER>
enabled=1
gpgcheck=0
#Optional - if you have GPG signing keys installed, use the below flags to verify the repository metadata signature:
#gpgkey=http://<ARTIFACTORY_URL>/rpm/<PATH_TO_REPODATA_FOLDER>/repomd.xml.key
#repo_gpgcheck=1