Configuring yum
By default, yum is configured through /etc/yum.conf. The following is an example of a typical /etc/yum.conf file:
[main] cachedir=/var/cache/yum keepcache=0 debuglevel=2 logfile=/var/log/yum.log distroverpkg=redhat-release tolerant=1 exactarch=1 obsoletes=1 gpgcheck=1 plugins=1 metadata_expire=1800 [myrepo] name=RHEL 5 $releasever - $basearch baseurl=http://local/path/to/yum/repository/ enabled=1
A typical The The following is a list of the most commonly-used options in the This option specifies the directory where Setting This option allows you to specify a directory where If This disables/enables GPG signature checking on packages on all repositories, including local package installation. The default is If this option is set in the This determines whether or not If When enabled ( The default value for this is This option allows you to exclude packages by keyword during installation/updates. If you are specifying multiple packages, this is a space-delimited list. Shell globs using wildcards (for example, * and ?) are allowed.
This sets the number of times The You can also specify repository information in a separate Each repository entry consists of the following mandatory parts:
The repository ID is a unique, one-word string that serves as a repository identifier. This is a human-readable string describing the repository.
This is a URL to the directory where the If a specific online repository requires basic HTTP authentication, you can specify your username and password in the The following is a list of options most commonly used in repository entries. For a complete list of repository entries, refer to This disables/enables GPG signature checking a specific repository. The default is This option allows you to point to a URL of the ASCII-armoured GPG key file for a repository. This option is normally used if If this option is set, This option is similar to the This option is the opposite of /etc/yum.conf file is made up of two types of sections: a [main] section, and a repository section. There can only be one [main] section, but you can specify multiple repositories in a single /etc/yum.conf.
[main] Options[main] section is mandatory, and there must only be one. For a complete list of options you can use in the [main] section, refer to man yum.conf.
[main] section.
cachedir
yum should store its cache and database files. By default, the cache directory of yum is /var/cache/yum.
keepcache=
<1 or 0>keepcache=1 instructs yum to keep the cache of headers and packages after a successful installation. keepcache=1 is the default.
reposdir=
<absolute path to directory of .repo files>.repo files are located. .repo files contain repository information (similar to the [ section of repository]/etc/yum.conf).
yum collects all repository information from .repo files and the [ section of the repository]/etc/yum.conf file to create a master list of repositories to use for each transaction. Refer to " [ Options" for more information about options you can use for both the repository][ section and repository].repo files.
reposdir is not set, yum uses the default directory /etc/yum.repos.d.
gpgcheck=
<1 or 0>gpgcheck=0, which disables GPG checking.
[main] section of the /etc/yum.conf file, it sets the GPG checking rule for all repositories. However, you can also set this on individual repositories instead; i.e., you can enable GPG checking on one repository while disabling it on another.
assumeyes=
<1 or 0>yum should prompt for confirmation of critical actions. The default if assumeyes=0, which means yum will prompt you for confirmation.
assumeyes=1 is set, yum behaves in the same way that the command line option -y does.
tolerant=
<1 or 0>tolerant=1), yum will be tolerant of errors on the command line with regard to packages. This is similar to the yum command line option -t.
tolerant=0 (not tolerant).
exclude=
<package name/s>retries=
<number of retries>yum should attempt to retrieve a file before returning an error. Setting this to 0 makes yum retry forever. The default value is 6.[ Optionsrepository][ section of the repository]/etc/yum.conf file contains information about a repository yum can use to find packages during package installation, updating and dependency resolution. A repository entry takes the following form:
[
repository ID]
name=repository name
baseurl=url, file or ftp://path to repository.repo files (for example, rhel5.repo). The format of repository information placed in .repo files is identical with the [ of repository]/etc/yum.conf.
.repo files are typically placed in /etc/yum.repos.d, unless you specify a different repository path in the [main] section of /etc/yum.conf with reposdir=. .repo files and the /etc/yum.conf file can contain multiple repository entries.
repository ID]
name=
repository namebaseurl=
http, file or ftp://pathrepodatadirectory of a repository is located. If the repository is local to the machine, use baseurl=file:// . If the repository is located online using HTTP, use path to local repositorybaseurl=http:// . If the repository is online and uses FTP, use linkbaseurl=ftp:// .
linkbaseurl line by prepending it as username:password@link. For example, if a repository on http://www.example.com/repo/ requires a username of "user" and a password os "password", then the baseurl link can be specified as baseurl=http://user:password@www.example.com/repo/.man yum.conf.
gpgcheck=
<1 or 0>gpgcheck=0, which disables GPG checking.
gpgkey=
URLyum needs a public key to verify a package and the required key was not imported into the RPM database.
yum will automatically import the key from the specified URL. You will be prompted before the key is installed unless you set assumeyes=1 (in the [main] section of /etc/yum.conf) or -y (in a yum transaction).
exclude=
<package name/s>exclude option in the [main] section of /etc/yum.conf. However, it only applies to the repository in which it is specified.
includepkgs=
<package name/s>exclude. When this option is set on a repository, yum will only be able to see the specified packages in that repository. By default, all packages in a repository are visible to yum.