Artifactory's RPM metadata calculation is based on pure Java.
It does not rely on the existence of the
When enabled, the metadata calculation is triggered automatically by some actions, and can also be invoked manually by others. Either way, the metadata produced is served to YUM clients.
RPM metadata is automatically calculated:
You can manually invoke RPM metadata calculation:
Metadata calculation cleans up RPM metadata that already existed as a result of manual deployment or import. This includes RPM metadata stored as SQLite database files.
filelists.xml metadata file of an RPM repository contains a list of all the files in each package hosted in the repository. When the repository contains many packages, reindexing this file as a result of interactions with the YUM client can be resource intensive causing a degradation of performance. Therefore, from version 5.4, reindexing this file is initially disabled when an RPM repository is created. To enable indexing
filelists.xml, set the Enable File List Indexing checkbox.
Note that the
filelists.xml metadata file for a virtual repository may not be complete (i.e. it may not actually list all the files it aggregates) if any of the repositories it aggregates do not have file listing enabled. Note that if indexing of the
filelists.xml file is disabled, it is not possible to search for a file using the YUM client to determine which package wrote the queried file to the filesystem.
To create an RPM local repository, in the Administration module go to Repositories | Repositories | Local, click New Local Repository and select RPM as the Package Type.
To enable automatic RPM metadata calculation on a local RPM repository, in the RPM Settings section of the Basic settings screen, set Auto-calculate RPM Metadata.
RPM Metadata Folder Depth
Informs Artifactory under which level of directory to search for RPMs and save the
By default this value is 0 and refers to the repository's root folder. In this case, Artifactory searches the entire repository for RPMs and saves the
Using a different depth is useful in cases where generating metadata for a repository separates its artifacts by name, version and architecture. This will allow you to create multiple RPM repositories under the same Artifactory RPM repository.
Auto-calculate RPM Metadata
|When set, RPM metadata calculation is automatically triggered by the actions described above.|
Enable File List Indexing
|When set, RPM metadata calculation will also include indexing the |
RPM Group File Names
A comma-separated list of YUM group files associated with your RPM packages.
Note that at each level (depth), the
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.
To define a remote repository to proxy an RPM remote repository, follow the steps below:
Next, create the
targetCentos.repo file and paste the following configuration into it:
[targetCentos] name=targetCentos baseurl=http://localhost:8081/artifactory/targetCentos/ enabled=1 gpgcheck=0
A Virtual Repository defined in Artifactory aggregates packages from both local and remote repositories.
This allows you to access both locally hosted RPM packages and remote proxied RPM repositories from a single URL defined for the virtual repository.
To define a virtual YUM repository, from the Administration module, go to Repositories | Repositories | Virtual, set the Package Type to be RPM, and select the underlying local and remote RPM repositories to include in the Basic settings tab.
To allow deploying packages to this repository, set the Default Deployment Repository.
Artifactory supports using a GPG key to sign RPM metadata repositories (not packages) for authentication by the YUM client.
To generate a pair of GPG keys and upload them to Artifactory, see Managing Signing Keys.
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:
artifactory.repo file with root privileges
sudo vi /etc/yum.repos.d/artifactory.repo
Paste the following configuration into the
[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>
For example, to deploy an RPM package into a repository called
rpm-local you could use the following:
curl -u<USERNAME>:<PASSWORD> -XPUT http://localhost:8080/artifactory/rpm-local/<PATH_TO_METADATA_ROOT> -T <TARGET_FILE_PATH>
where PATH_TO_METADATA_ROOT specifies the path from the repository root to the deploy folder.
You can deploy RPM modules to the
repodata folder using the
modules.yaml file which contains all the desired modules and then proceed to trigger a repository index to update the
repomd.xml and other metadata files with the modules information.
You can perform the upload directly in the JFrog Platform UI or using the following command.
curl -u <USERNAME>:<PASSWORD> -XPUT "http://localhost:8081/artifactory/rpm-local/<PATH_TO_REPODATA_FOLDER>/modules.yaml -T <TARGET_MODULES_FILE_PATH>"
A YUM group is a set of RPM packages collected together for a specific purpose. For example, you might collect a set of "Development Tools” together as a YUM group.
A group is specified by adding a group XML file to same directory as the RPM packages included in it. The group file contains the metadata of the group including pointers to all the RPM files that make up the group.
A group file can also be created by running the following command:
sudo yum-groups-manager -n "My Group" --id=mygroup --save=mygroups.xml --mandatory yum glibc rpm
The process of attaching YUM group metadata to a local repository is simple:
.gzfile and deploy it next to the deployed group XML file.
.gzfile) to the
The following table lists some useful YUM group commands:
|Install the YUM group. The group must be deployed to the root of the YUM local repository.|
|Remove the RPM group|
Update the RPM group. The group must be deployed to the root of the YUM local repository.
|List the RPM packages within the group.|
|List the YUM groups|
YUM group properties can be set in the
/etc/yum.config file as follows:
|overwrite_groups||0 or 1|
Determines YUM's behavior if two or more repositories offer package groups with the same name.
If set to 1 then the group packages of the last matching repository will be used.
If set to 0 then the groups from all matching repositories will be merged together as one large group.
|groupremove_leaf_only||0 or 1|
Determines YUM's behavior when the groupremove command is run.
If set to 0 (default) then all packages in the group will be removed.
If set to 1 then only those packages in the group that aren't required by another package will be removed.
|enable_group_conditionals||0 or 1|
Determines whether YUM will allow the use of conditionals packages.
If set to 0 then conditionals are not allowed
If set to 1 (default) package conditionals are allowed.
|group_package_types||optional, default, mandatory||Tells YUM which type of packages in groups will be installed when |
If your organization uses a proxy server as an intermediary for Internet access, specify the
proxy settings in
/etc/yum.conf. If the proxy server also requires authentication, you also need to specify the
proxy=<proxy server url> proxy_username=<user> proxy_password=pass
If you use the yum plugin (
yum-rhn-plugin) to access the ULN, specify the
httpProxy settings in
/etc/sysconfig/rhn/up2date. In addition, If the proxy server requires authentication, you also need to specify the
proxyPassword settings as shown below.
enableProxy=1 httpProxy=<proxy server url> enableProxyAuth=1 proxyUser=<user> proxyPassword=<password>
YUM supports SSL from version 3.2.27.
To secure a repository with SSL, execute the following steps:
Define your protected repository in a
.repo file as follows:
[protected] name = SSL protected repository baseurl=<secure repo url> enabled=1 gpgcheck=1 gpgKey=<URL to public key> sslverify=1 sslclientcert=<path to .cert file> sslclientkey=<path to .key file>
gpgkey is a URL pointing to the ASCII-armored GPG key file for the repository . This option is used if YUM needs a public key to verify a package and the required key has not been imported into the RPM database.
If this option is set, YUM will automatically import the key from the specific URL. You will be prompted before the key is installed unless the
assumeyes option is set.
You can use and reference the following built-in variables in
yum commands and in all YUM configuration files (i.e.
/etc/yum.conf and all
.repo files in the
|This is replaced with the package's version, as listed in |
|This is replaced with your system's architecture, as listed by |
|This is replaced with your base architecture. For example, if |
The following code block is an example of how your
/etc/yum.conf file might look:
[main] cachedir=/var/cache/yum/$basearch/$releasever keepcache=0 debuglevel=2 logfile=/var/log/yum.log exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 installonly_limit=3 [comments abridged]
You can view all the metadata that annotates an RPM by choosing it in Artifactory's tree browser and selecting the RPM Info tab:
The corresponding RPM metadata fields are automatically added as properties of an RPM artifact in YUM repositories accessed through Artifactory:
Properties can be used for searching and other functions. For more details see Property Sets.
Watch this short screencast to learn how easy it is to host RPMs in Artifactory.
<iframe width="560" height="315" src="https://www.youtube.com/embed/cV4mfBJ4JGQ" frameborder="0" allowfullscreen></iframe>