yum
and related utilities is located at /etc/yum.conf
. This file contains one mandatory [main]
section, which allows you to set Yum options that have global effect, and may also contain one or more [repository]
sections, which allow you to set repository-specific options. However, best practice is to define individual repositories in new or existing .repo
files in the /etc/yum.repos.d/
directory. The values you define in the [main]
section of the /etc/yum.conf
file may override values set in individual [repository]
sections.
[main]
section of the /etc/yum.conf
configuration file;
[repository]
sections in /etc/yum.conf
and .repo
files in the /etc/yum.repos.d/
directory;
/etc/yum.conf
and files in the /etc/yum.repos.d/
directory so that dynamic version and architecture values are handled correctly;
/etc/yum.conf
configuration file contains exactly one [main]
section, and while some of the key-value pairs in this section affect how yum
operates, others affect how Yum treats repositories. You can add many additional options under the [main]
section heading in /etc/yum.conf
.
/etc/yum.conf
configuration file can look like this:
[main]
cachedir=/var/cache/yum/$basearch/$releasever
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=3
[comments abridged]
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[main]
section:
assumeyes
=value0
— yum
should prompt for confirmation of critical actions it performs. This is the default.
1
— Do not prompt for confirmation of critical yum
actions. If assumeyes=1
is set, yum
behaves in the same way that the command line option -y
does.
cachedir
=directory/var/cache/yum/$basearch/$releasever
.
$basearch
and $releasever
Yum variables.
debuglevel
=value1
and 10
. Setting a higher debuglevel
value causes yum
to display more detailed debugging output. debuglevel=0
disables debugging output, while debuglevel=2
is the default.
exactarch
=value0
— Do not take into account the exact architecture when updating packages.
1
— Consider the exact architecture when updating packages. With this setting, yum
will not install an i686 package to update an i386 package already installed on the system. This is the default.
exclude
=package_name [more_package_names]*
and ?
) are allowed.
gpgcheck
=value0
— Disable GPG signature-checking on packages in all repositories, including local package installation.
1
— Enable GPG signature-checking on all packages in all repositories, including local package installation. gpgcheck=1
is the default, and thus all packages' signatures are checked.
[main]
section of the /etc/yum.conf
file, it sets the GPG-checking rule for all repositories. However, you can also set gpgcheck=value
for individual repositories instead; that is, you can enable GPG-checking on one repository while disabling it on another. Setting gpgcheck=value
for an individual repository in its corresponding .repo
file overrides the default if it is present in /etc/yum.conf
.
groupremove_leaf_only
=value0
— yum
should not check the dependencies of each package when removing a package group. With this setting, yum
removes all packages in a package group, regardless of whether those packages are required by other packages or groups. groupremove_leaf_only=0
is the default.
1
— yum
should check the dependencies of each package when removing a package group, and remove only those packages which are not not required by any other package or group.
installonlypkgs
=space separated list of packagesyum
can install, but will never update. See the yum.conf(5) manual page for the list of packages which are install-only by default.
installonlypkgs
directive to /etc/yum.conf
, you should ensure that you list all of the packages that should be install-only, including any of those listed under the installonlypkgs
section of yum.conf(5). In particular, kernel packages should always be listed in installonlypkgs
(as they are by default), and installonly_limit
should always be set to a value greater than 2
so that a backup kernel is always available in case the default one fails to boot.
installonly_limit
=valueinstallonlypkgs
directive.
installonlypkgs
directive include several different kernel packages, so be aware that changing the value of installonly_limit
will also affect the maximum number of installed versions of any single kernel package. The default value listed in /etc/yum.conf
is installonly_limit=3
, and it is not recommended to decrease this value, particularly below 2
.
keepcache
=value0
— Do not retain the cache of headers and packages after a successful installation. This is the default.
1
— Retain the cache after a successful installation.
logfile
=file_nameyum
should write its logging output. By default, yum
logs to /var/log/yum.log
.
multilib_policy
=valuebest
— install the best-choice architecture for this system. For example, setting multilib_policy=best
on an AMD64 system causes yum
to install 64-bit versions of all packages.
all
— always install every possible architecture for every package. For example, with multilib_policy
set to all
on an AMD64 system, yum
would install both the i586 and AMD64 versions of a package, if both were available.
obsoletes
=value0
— Disable yum
's obsoletes processing logic when performing updates.
1
— Enable yum
's obsoletes processing logic when performing updates. When one package declares in its spec file that it obsoletes another package, the latter package will be replaced by the former package when the former package is installed. Obsoletes are declared, for example, when a package is renamed. obsoletes=1
the default.
plugins
=value0
— Disable all Yum plug-ins globally.
Disabling all plug-ins is not advised
Yum
services. Disabling plug-ins globally is provided as a convenience option, and is generally only recommended when diagnosing a potential problem with Yum
.
1
— Enable all Yum plug-ins globally. With plugins=1
, you can still disable a specific Yum plug-in by setting enabled=0
in that plug-in's configuration file.
reposdir
=directory.repo
files are located. All .repo
files contain repository information (similar to the [repository]
sections of /etc/yum.conf
). yum
collects all repository information from .repo
files and the [repository]
section of the /etc/yum.conf
file to create a master list of repositories to use for transactions. If reposdir
is not set, yum
uses the default directory /etc/yum.repos.d/
.
retries
=value0
or greater. This value sets the number of times yum
should attempt to retrieve a file before returning an error. Setting this to 0
makes yum
retry forever. The default value is 10
.
[main]
options, refer to the [main] OPTIONS
section of the yum.conf(5) manual page.