Product SiteDocumentation Site

Chapter 4. YUM Configuration

4.1. General Configuration
4.2. YUM Variables
4.3. Cache Management
4.4. Priority Configuration
4.5. Bandwidth Control
4.6. Proxy Configuration
4.7. Multiarchitecture Policy
4.8. Management of YUM Repositories
4.8.1. Add New Repositories
4.8.2. Manual Configuration of a Repository
4.8.3. Removing Repositories
4.8.4. The Fedora Repositories
4.8.5. Third Party and Personal Repositories
4.8.6. List of Mirrors and Metalink
4.8.7. Configuration for Package Protection
This section of the manual will review the YUM system configuration to be able to understand its overall functionality.
The general configuration of the YUM system is found in /etc/yum.conf and the configured YUM repositories are defined in /etc/yum.repos.d/.
To understand the configurations we will analyze the configuration files once Fedora is installed. For more advanced configurations, one can always consult the online manual pages man yum and man yum.conf.

4.1. General Configuration

To begin, start your favorite text editor and open the general configuration file for YUM, /etc/yum.conf, and you will see content similar to what is shown below.
/etc/yum.conf
[main]
cachedir=/var/cache/yum
keepcache=0
debuglevel=2
logfile=/var/log/yum.log
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
installonly_limit=2

#  This is the default, if you make this bigger yum won't see if the metadata
# is newer on the remote and so you'll "gain" the bandwidth of not having to
# download the new metadata and "pay" for it by yum not having correct
# information.
#  It is esp. important, to have correct metadata, for distributions like
# Fedora which don't keep old packages around. If you don't like this checking
# interupting your command line usage, it's much better to have something
# manually check the metadata once an hour (yum-updatesd will do this).
# metadata_expire=90m

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
The first notable aspect of the YUM configuration file is the block structure with sections identified with brackets: [section]. This structure repeats when the repositories are configured. In this case yum.conf in the section [main] define the general behavior of the YUM system, and establish the base directives, for example, where to store the cache. Each of the directives mentioned are commented on below.
cachedir
Directory where YUM should store its cache and file db. The default value is /var/cache/yum.
keepcache
Can be '1' or '0'. It determines whether YUM should keep a cache of the headers and packages after a successful installation. Default value is '1' (keep the files).
debuglevel
Level of
logfile
Complete path to the name of the file where YUM should write its logging.
exactarch
Can be '1' or '0'. Setting it to '1' causes, for example, yum update to only update the packages of the architecture that is installed. With the option active, the command yum won't intall an i686 package to update an i386 package. The default value is '1'.
obsoletes
This option only has an effect during an upgrade. It enables the YUM obsolescence processing logic. It is useful when a distribution level upgrade is being done. See also: the documentation of the command yum upgrade for more details. Command line option: --obsoletes.
gpgcheck
Can be '1' or '0'. This indicates to YUM whether or not it should check the GPG signature of the packages. When it is enabled in [main] section, it establishes a default behavior for all of the repositories. This option also determines whether an installation of a local RPM will have its GPG signature checked or not. The default value is '0'.
plugins
Either '0 'or '1'. It is a global switch to enable or disable YUM extensions (plugins). Its default value is '0 '(extensions disabled). See the PLUGINS section of yum man page (man 8 yum) for more information about installing YUM extensions.
metadata_expire
Duration in seconds after which the metadata will expire. So if the current metadata downloaded is some seconds younger, then yum will not update the repository metadata. If you think that yum is not downloading the update information as often as you wish, reduce the value of this parameter. You can also change the default format in seconds to days, hours or minutes adding d,h or m to the specified value. The default is 1.5 hours, for running yum-updatesd every hour. You can also use the word never meaning that the metadata will never expire.
Due to the nature of certain software, in particular the kernel, it is necessary to have installed more than one version at a time for different reasons, the following parameters are relevant in such cases.
installonlypkgs
List of packages that must be always installed, never updated. In particular the kernel falls into this category. The default value is kernel, kernel-smp, kernel-bigmem, kernel-enterprise, kernel-debug, kernel-unsupported.
installonly_limit
Number of packages listed in installonlypkgs to be kept installed at the same time. Setting this value to 0 disables the function. The default value is ’2’.
These are just some YUM system configuration directives, for more, man yum.conf. You may include the repositories configuration within yum.conf but that kind of configuration is deprecated and it is preferred to use individual files in /etc/yum.repos.d/ which will be described later in this manual.