Metadata calculation cleans up YUM metadata that already existed as a result of manual deployment or import. This includes RPM metadata stored as SQLite database files.
To enable RPM metadata calculation on a local repository, select the repository which you want to enable as a YUM repository as described in Configuring Repositories, and select the Packages tab, set Auto-calculate YUM Metadata.
YUM Metadata Folder Depth
Informs Artifactory under which level of directory to search for RPMs and save the repodata directory.
By default this value is 0 and refers to the repository's root folder. In this case, Artiafctory searches the entire repository for RPMs and saves the repodata directory at $REPO-KEY/repodata.
Using a different depth is useful in cases where generating metadata for a repository separates its artifacts by name, version and architecture.
For example: If the repository layout is similar to that shown below and you want to generate RPM metadata for every artifact divided by name, set the Depth to 1 and the repodata directory is saved at REPO_ROOT/ARTIFACT_NAME/repodata :
YUM Group File Names
A comma-separated list of YUM group files associated with your YUM packages.
Note that at each level (depth), the repodata directory in your repository may contain a different group file name, however each repodata directory may contain only 1 group metadata file (multiple groups should be listed as different tags inside the XML file. For more details, please refer to the YUM Documentation).
Auto-calculate YUM Metadata
When set, YUM metadata calculation is automatically triggered by the actions described above.
Metadata calculation is asynchronous and does not happen immediately when triggered, whether automatically or manually.
Artifactory invokes the actual calculation only after a certain "quiet period", so the creation of metadata normally occurs only 1-2 minutes after the calculation was triggered.
Using Yum to install RPM packages from Artifactory
After configuring the yum-local repository in Artifactory, you need to configure your local machine to install software packages from it by executing the following steps:
Edit the artifactory.repo file with root privileges
Paste the following configuration into the artifactory.repo file:
Now, every RPM file deployed to the root of the yum-local repository can be installed using:
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:
Attaching a YUM Group
The process of attaching YUM group metadata to a local repository is simple:
Create an XML file in the groups format used by YUM. You can either just type it out manually using any text editor, or run the yum-groups-manager command from yum-utils.
Deploy the created group file to the repodata folder. Artifactory will automatically perform the following steps:
Create the corresponding .gz file and deploy it next to the deployed group XML file.
Invoke a YUM calculation on the local repository.
Attach the group information (both the XML and the .gz file) to the repomd.xml file.
Make sure the group file names are listed in the YUM Group File Names field of the Packages tab. This tells Artifactory which files should be attached as repository group information.
This is how a local repository may appear after deploying a groups.xml metadata file to it (repodatais calculated to depth 0):
YUM Group Commands
The following table lists some useful YUM group commands:
yum groupinstall <Group ID>
Install the YUM group. The group must be deployed to the root of the YUM local repository.
yum groupremove <Group ID>
Remove the RPM group
yum groupupdate <Group ID>
Update the RPM group. The group must be deployed to the root of the YUM local repository.
yum groupinfo <Group ID>
List the RPM packages within the group.
yum grouplist | more
List the YUM groups
Setting Group Properties
YUM group properties can be set in the /etc/yum.config file as follows:
0 or 1
Determines YUM's behavior if two or more repositories offer package groups with the same name.
If set to1 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.
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.
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.
optional, default, mandatory
Tells YUM which type of packages in groups will be installed when groupinstall is called. Default is: default, mandatory
Proxy Server Settings
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_username, and proxy_password settings.
If you use the yum plugin (yum-rhn-plugin) to access the ULN, specify the enableProxy and httpProxy settings in /etc/sysconfig/rhn/up2date. In addition, If the proxy server requires authentication, you also need to specify the enableProxyAuth, proxyUser, and proxyPassword settings as shown below.
YUM supports SSL from version 3.2.27.
To secure a repository with SSL, execute the following steps:
Generate a private key and certificate using
Define your protected repository in a .repo file as follows:
where: 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.
Using Yum Variables
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 /etc/yum.repos.d/ directory):
This is replaced with the package's version, as listed in distroverpkg. This defaults to the version of the redhat-release package.
This is replaced with your system's architecture, as listed by os.uname() in Python.
This is replaced with your base architecture. For example, if $arch=i686 then $basearch=i386
The following code block is an example of how your /etc/yum.conf file might look:
Creating A GPG Key and Signing RPMs
In order to create a GPG Key for signing RPMs ,use the gnupg package and gpg utilities (notice that gnupg2 will not work with these steps).
Creating a Public/Private GPG Key Pair
The following commands create a Private/Public GPG Key Pair (Note you should actually login to console/ssh with this user, not sudo to it):
You will be asked a series of questions, answer as follows (answers in italic):
Please select what kind of key you want: (1) DSA and ElGamal (default)
It is not recommended to generate private/public key pair on your production systems because they are exposed to the public internet and are therefore more vulnerable to being exposed.
Generating the GPG key may take some time, and once complete will display the following output:
The ID of your public key is displayed after the first line after the slash ('/') character. In the above example, the ID of the public key is 454CBFAB.
Exporting Private/Public Keys for Safe Keeping
You must export the keys so that you can save them in a secure location (and also, so that they can be imported in the future). To list the keys you have installed execute the following command:
Exporting the Public GPG Key
In order to use the GPG Key with RedHat Network (RHN), you will need to make the Public portion available in a Public GPG Key by executing the following commands:
The Public Key is the only portion that should ever be made public. The Private Key must be kept secure, preferably on a system that does not allow outside access from the public internet. It is also recommended to make a hard copy (burned on a CD/USB key) of the Public/Private key pair and keep that somewhere secure like a Safe Deposit Box. Anyone who obtains your Private/Public key pair can sign RPMs as if they were signed by you and potentially perform malicious acts in your name.
You will need to make the public key available, and a common way to do this is to upload it to your web server (usually in the /pub folder or root of your repository).