[main] Options
The [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.
The following is a list of the most commonly-used options in the [main] section.
cachedir-
This option specifies the directory where
yumshould store its cache and database files. By default, the cache directory ofyumis/var/cache/yum.
keepcache=<1 or 0>-
Setting
keepcache=1instructsyumto keep the cache of headers and packages after a successful installation.keepcache=1is the default. reposdir=<absolute path to directory of .repo files>-
This option allows you to specify a directory where
.repofiles are located..repofiles contain repository information (similar to the[section ofrepository]/etc/yum.conf).yumcollects all repository information from.repofiles and the[section of therepository]/etc/yum.conffile 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 therepository][section andrepository].repofiles.If
reposdiris not set,yumuses the default directory/etc/yum.repos.d. gpgcheck=<1 or 0>-
This disables/enables GPG signature checking on packages on all repositories, including local package installation. The default is
gpgcheck=0, which disables GPG checking.If this option is set in the
[main]section of the/etc/yum.conffile, 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>-
This determines whether or not
yumshould prompt for confirmation of critical actions. The default ifassumeyes=0, which meansyumwill prompt you for confirmation.If
assumeyes=1is set,yumbehaves in the same way that the command line option-ydoes. tolerant=<1 or 0>-
When enabled (
tolerant=1),yumwill be tolerant of errors on the command line with regard to packages. This is similar to theyumcommand line option-t.The default value for this is
tolerant=0(not tolerant). exclude=<package name/s>-
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.
retries=<number of retries>-
This sets the number of times
yumshould attempt to retrieve a file before returning an error. Setting this to 0 makesyumretry forever. The default value is 6.