Chapter 3. Configuring YUM

The configuration information for YUM and related utilities is stored in the /etc/yum.conf file. This file contains one mandatory [main] section, which enables you to set YUM options that have global effect.

The following sections describe how to:

  • View the current YUM configurations.
  • Set YUM [main] options.
  • Use YUM plug-ins.

3.1. Viewing the current YUM configurations

The following procedure describes how to display the current YUM configuration.

Procedure

  • To display the current values of global yum options specified in the [main] section of the /etc/yum.conf file, use:

    # yum config-manager --dump

3.2. Setting YUM main options

The /etc/yum.conf configuration file contains one [main] section. The key-value pairs in this section affect how YUM operates and treats repositories.

You can add additional options under the [main] section heading in /etc/yum.conf.

For a complete list of available [main] options, see the [main] OPTIONS section of the yum.conf(5) man page.

3.3. Using YUM plug-ins

YUM provides plug-ins that extend and enhance its operations. Certain plug-ins are installed by default.

The following procedures describe how to enable, configure, and disable YUM plug-ins.

3.3.1. Managing YUM plug-ins

The plug-in configuration files always contain a [main] section in which the enabled= option controls whether the plug-in is enabled when you run yum commands. If this option is missing, you can add it manually to the file.

Every installed plug-in has its own configuration file in the /etc/dnf/plugins/ directory. You can enable or disable plug-in specific options in these files.

3.3.2. Enabling and disabling YUM plug-ins

In the YUM v4 version of the YUM tool, plug-ins are enabled by default.

The following procedure describes how to disable or enable all YUM plug-ins, disable all plug-ins for a particular command, or certain YUM plug-ins for a single command.

Procedure

  • To disable or enable all YUM plug-ins, ensure a line beginning with plugins= is present in the [main] section of the /etc/yum.conf file.

    1. To disable all YUM plug-ins, set the value of plugins= to 0.
    2. To enable all YUM plug-ins, set the value of plugins= to 1.

      Important

      Disabling all plug-ins is not advised. Certain plug-ins provide important YUM services and commands. In particular, the product-id and subscription-manager plug-ins provide support for the certificate-based Content Delivery Network (CDN). Disabling plug-ins globally is provided as a convenience option, and is advisable only when diagnosing a potential problem with YUM.

  • To disable all YUM plug-ins for a particular command, append --noplugins option to the command. For example, to disable YUM plug-ins for the update command:

    # yum --noplugins update
  • To disable certain YUM plug-ins for a single command, append --disableplugin=plugin-name option to the command. For example, to disable certain yum plug-ins for the update command:

    # yum update --disableplugin=plugin-name

    Replace plugin-name with the name of the plug-in.

  • To enable certain YUM plug-ins for a single command, append --enableplugin=plugin-name option to the command. For example, to disable certain yum plug-ins for the update command:

    # yum update --enableplugin=plugin-name

    Replace plugin-name with the name of the plug-in.