ARTIFACTORY: How to Manually Run an RPM Repository Metadata Calculation When Auto Calculate RPM Metadata Is Enabled

Pradnya Shinde
2023-01-22 11:11

To ensure that your index is calculated and RPM is ready to install, enable Auto Calculate RPM Metadata for an RPM repository in Artifactory. This functionality will allow you to recalculate your indexes manually, as and when needed. To configure it properly, do one of the following:

  1. If you’d like to enable Auto Calculate RPM Metadata, but still want to invoke command line, manual metadata calculations, use the Calculate YUM Repository Metadata REST API, which is available HERE . Following is an example of this REST API in practice, where async=1:

curl -uadmin:<password> -XPOST "localhost:8081/artifactory/api/yum/rpm-local?async=1" -i -Lvv

This will return a 202 (accepted) response, as this command line is an asynchronous request to calculate the metadata.
RPM metadata is calculated automatically when:

  • deploying/removing/copying/moving RPM files

  • performing content imports (both from the system and repositories)

  • Via Artifactory's Calculate YUM Repository Metadata REST-API

Note: With Auto Calculate RPM Metadata enabled, RPM metadata calculations will be triggered automatically by the actions described above.

  1. If you’d like to perform a manual sync metadata calculation, you may do so only when the Auto Calculate RPM Metadata has been disabled. Thereafter, you’ll be able to manually control the triggering of YUM metadata calculations. This can be used if you want to ensure all of the metadata on the repository is available to be served to any requesting client by holding the request until the calculation is finished. Following is an example of a sync API in practice, where async=0:

curl -uadmin:<password> -XPOST "localhost:8081/artifactory/api/yum/rpm-local?async=0" -i -Lvv

This will return a 200 (OK) response, as this command line is a synchronous request to calculate the metadata.
You can manually invoke RPM metadata calculations:

  • By selecting a local repository in your Artifactory Tree Browser and clicking Recalculate Index in the Actions menu

Published: Apr. 13, 2019
Last updated: Feb. 25, 2021

Keywords: Artifactory RPM metadata calculation, RPM repository