/etc/yum.conf
The /etc/yum.conf
file is the main configuration file for the YUM (Yellowdog Updater, Modified) package manager, used in Red Hat-based Linux distributions such as Fedora, CentOS, and RHEL. This file contains global configuration options that control the behavior of the YUM package manager.
Structure of /etc/yum.conf
/etc/yum.conf
The /etc/yum.conf
file is a plain text file and is usually divided into sections, with each section containing key-value pairs. The most common section is [main]
, which defines global settings.
Example /etc/yum.conf
/etc/yum.conf
Here is an example of what the /etc/yum.conf
file might look like:
Key Directives in /etc/yum.conf
/etc/yum.conf
cachedir
: Specifies the directory where YUM stores downloaded packages and cache data. The$basearch
and$releasever
variables are automatically replaced with the appropriate architecture and release version of the distribution.keepcache
: Determines whether YUM should keep the cache of packages after installation. Set to0
to remove cached packages after installation, and1
to keep them.debuglevel
: Sets the level of debugging information in the YUM output. Ranges from0
(no debugging) to10
(most verbose).logfile
: Specifies the path to the log file where YUM logs its actions.exactarch
: When set to1
, YUM will only install packages that match the system's architecture.obsoletes
: When set to1
, YUM will allow obsoleting of packages. This is useful for distribution upgrades.gpgcheck
: When set to1
, YUM will perform a GPG signature check on packages to ensure their authenticity and integrity.plugins
: When set to1
, YUM will enable the use of YUM plugins.installonly_limit
: Limits the number of versions of each package that can be installed simultaneously. This is particularly useful for limiting the number of kernel versions on the system.
Additional Configuration Options
exclude
: Excludes specific packages from being installed or updated.includepkgs
: Only includes specified packages for installation or updates.proxy
: Specifies a proxy server to use for HTTP and HTTPS connections.proxy_username
andproxy_password
: Credentials for the proxy server.
Managing Repositories
In addition to the global configuration in /etc/yum.conf
, YUM repositories are typically defined in separate .repo
files located in the /etc/yum.repos.d/
directory. Each repository file contains configuration options specific to that repository.
Example Repository File
Here is an example of a repository configuration file /etc/yum.repos.d/example.repo
:
Conclusion
The /etc/yum.conf
file is an essential configuration file for the YUM package manager, allowing you to control various global settings for package management on Red Hat-based systems. Understanding and configuring this file correctly can help optimize your system's package management processes.
Last updated