Product SiteDocumentation Site

9.2. Repository Definition Files

Create and edit repository definition files with a text editor. Definition files are plain-text with a standard format:
       name=Some longer name and description for this repository
       enable=(0 to disable this file, or 1 to enable it)
       gpgcheck=(0 to disable checking signatures of packages from this repository, or 1 to enable checking)

Example 1. Format of yum Repository Definition Files

The baseurl must specify the complete URL for the root directory of the repository, including the http://, https:// or ftp:// prefix. You may also specify a directory on your system, by using the prefix file:// in the baseurl.

Logging in to Protected Repositories

To use a password-protected repository, include the correct username and password in the baseurl. For example,$releasever/mypackages/.
If possible, list more than one directory or server that holds a copy of the repository. This enables yum to use another repository if the first is unavailable. By default yum randomly selects repositories from the baseurl list. To force yum to use them in sequence, add the option failovermethod=priority.
It is also good practice to use variables like $releasever in the URL, rather than setting these to a specific value. The available variables are listed on the man page for yum.conf. Using variables enables the same definition to function when your system is upgraded to a later version, or if the configuration is copied to another machine.
A definition file is shown below that uses all of these features. In this example, copies of the repository are held in the directory /srv/software/Fedora;/3;/mypackages/ on the system itself, in the directory software/Fedora;/3;/mypackages/ on the Web server, and in the directory pub/software/Fedora;/3;/mypackages/ on the FTP server Here, yum will access the FTP server with the username yum-user and the password qwerty. The failovermethod ensures that yum will check the copy on the local machine, before trying the servers in sequence.
       name=Some packages for Fedora $releasever

Example 2. A yum Repository Definition File with Failover

To use a list of servers, substitute mirrorlist for baseurl.
Set gpgcheck=0 if it is necessary to disable signature checking for the packages provided by this repository. Avoid distributing or installing unsigned packages.