• Aucun résultat trouvé

Set t ing [main] Opt ions

7.4 . Working wit h T ransact ion Hist ory

7.5. Configuring Yum and Yum Reposit ories

7.5.1. Set t ing [main] Opt ions

The /etc/yum. co nf configuration file contains exactly one [mai n] 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 [mai n] section heading in /etc/yum. co nf.

A sample /etc/yum. co nf 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

The following are the most commonly used options in the [mai n] section:

assumeyes= value

The assumeyes option determines whether or not yum prompts for confirmation of critical actions. Replace value with one of:

0 (default) — yum prompts for confirmation of critical actions it performs.

1 — Do not prompt for confirmation of critical yum actions. If assumeyes= 1 is set, yum behaves in the same way as the command-line options -y and --assumeyes.

cached i r= directory

Use this option to set the directory where yum stores its cache and database files. Replace directory with an absolute path to the directory. By default, yum's cache directory is

/var/cache/yum/$basearch/$rel easever.

See Section 7.5.3, “ Using Yum Variables” for descriptions of the $basearch and

$rel easever yum variables.

d ebug l evel= value

This option specifies the detail of debugging output produced by yum. Here, value is an integer between 1 and 10. Setting a higher d ebug l evel value causes yum to display more detailed debugging output. d ebug l evel = 2 is the default, while d ebug l evel = 0 disables debugging output.

exactarch= value

With this option, you can set yum to consider the exact architecture when updating already installed packages. Replace value with:

0 — Do not take into account the exact architecture when updating packages.

1 (default) — Consider the exact architecture when updating packages. With this setting, yum does not install a package for 32-bit architecture to update a package already installed on the system with 64-bit architecture.

excl ud e= package_name [ more_package_names]

The excl ud e option enables you to exclude packages by keyword during installation or system update. Listing multiple packages for exclusion can be accomplished by quoting a space-delimited list of packages. Shell glob expressions using wildcards (for example, * and ?) are allowed.

g pg check= value

Use the g pg check option to specify if yum should perform a GPG signature check on packages. Replace value with:

0 — Disable GPG signature-checking on packages in all repositories, including local package installation.

1 (default) — Enable GPG signature-checking on all packages in all repositories, including local package installation. With g pg check enabled, all packages' signatures are checked.

If this option is set in the [mai n] section of the /etc/yum. co nf file, it sets the GPG-checking rule for all repositories. However, you can also set g pg check= value for individual repositories instead; that is, you can enable GPG-checking on one repository while disabling it on another. Setting g pg check= value for an individual repository in its corresponding . repo file overrides the default if it is present in /etc/yum. co nf.

For more information on GPG signature-checking, see Section A.3.2, “ Checking Package Signatures”.

g ro up_co mmand= value

Use the g ro up_co mmand option to specify how the yum g ro up i nstal l, yum g ro up upg rad e, and yum g ro up remo ve commands handle a package group. Replace value with on of:

si mpl e — Install all members of a package group. Upgrade only previously installed packages, but do not install packages that have been added to the group in the meantime.

co mpat — Similar to si mpl e but yum upg rad e also installs packages that were added to the group since the previous upgrade.

o bjects — (default.) With this option, yum keeps track of the previously installed groups and distinguishes between packages installed as a part of the group and packages installed separately. See Example 7.14, “ Viewing information on the LibreOffice package group”

g ro up_packag e_types= package_type [ more_package_types]

Here you can specify which type of packages (optional, default or mandatory) is installed when the yum g ro up i nstal l command is called. The default and mandatory package types are chosen by default.

hi sto ry_reco rd= value

With this option, you can set yum to record transaction history. Replace value with one of:

0 — yum should not record history entries for transactions.

1 (default) — yum should record history entries for transactions. This operation takes certain amount of disk space, and some extra time in the transactions, but it provides a lot of information about past operations, which can be displayed with the yum hi sto ry command. hi sto ry_reco rd = 1 is the default.

For more information on the yumhi sto ry command, see Section 7.4, “ Working with Transaction History”.

Note

Yum uses history records to detect modifications to the rpmd b data base that have been done outside of yum. In such case, yum displays a warning and automatically searches for possible problems caused by altering rpmd b. With hi sto ry_reco rd turned off, yum is not able to detect these changes and no automatic checks are performed.

i nstal l o nl ypkg s= space separated list of packages

Here you can provide a space-separated list of packages which yum can install, but will never update. See the yum. co nf(5) manual page for the list of packages which are install-only by default.

If you add the i nstal l o nl ypkg s directive to /etc/yum. co nf, you should ensure that you list all of the packages that should be install-only, including any of those listed under the i nstal l o nl ypkg s section of yum. co nf(5). In particular, kernel packages should always be listed in i nstal l o nl ypkg s (as they are by default), and

i nstal l o nl y_l i mi t 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.

⁠i nstal l o nl y_l i mi t= value

This option sets how many packages listed in the i nstal l o nl ypkg s directive can be installed at the same time. Replace value with an integer representing the maximum number of versions that can be installed simultaneously for any single package listed in

i nstal l o nl ypkg s.

The defaults for the i nstal l o nl ypkg s directive include several different kernel

packages, so be aware that changing the value of i nstal l o nl y_l i mi t also affects the maximum number of installed versions of any single kernel package. The default value listed in /etc/yum. co nf is i nstal l o nl y_l i mi t= 3, and it is not recommended to decrease this value, particularly below 2.

keepcache= value

The keepcache option determines whether yum keeps the cache of headers and packages after successful installation. Here, value is one of:

after successful installation. Here, value is one of:

0 (default) — Do not retain the cache of headers and packages after a successful installation.

1 — Retain the cache after a successful installation.

l o g fi l e= file_name

To specify the location for logging output, replace file_name with an absolute path to the file in which yum should write its logging output. By default, yum logs to

/var/l o g /yum. l o g. max_co nnencti o ns= number

Here value stands for the maximum number of simultaneous connections, default is 5.

mul ti l i b_po l i cy= value

The mul ti l i b_po l i cy option sets the installation behavior if several architecture versions are available for package install. Here, value stands for:

best — install the best-choice architecture for this system. For example, setting

mul ti l i b_po l i cy= best on an AMD64 system causes yum to install the 64-bit versions of all packages.

al l — always install every possible architecture for every package. For example, with mul ti l i b_po l i cy set to al l on an AMD64 system, yum would install both the i686 and AMD64 versions of a package, if both were available.

o bso l etes= value

The o bso l etes option enables the obsoletes process logic during updates.When one package declares in its spec file that it obsoletes another package, the latter package is replaced by the former package when the former package is installed. Obsoletes are declared, for example, when a package is renamed. Replace value with one of:

0 — Disable yum's obsoletes processing logic when performing updates.

1 (default) — Enable yum's obsoletes processing logic when performing updates.

pl ug i ns= value

This is a global switch to enable or disable yum plug-ins, value is one of:

0 — Disable all yum plug-ins globally.

Important

Disabling all plug-ins is not advised because certain plug-ins provide important yum services. In particular, p ro d u ct - id and su b scrip t io n - man ag er plug-ins provide support for the certificate-based C o ntent D el i very Netwo rk (CDN).

Disabling plug-ins globally is provided as a convenience option, and is generally only recommended when diagnosing a potential problem with yum.

1 (default) — Enable all yum plug-ins globally. With pl ug i ns= 1, you can still disable a specific yum plug-in by setting enabl ed = 0 in that plug-in's configuration file.

For more information about various yum plug-ins, see Section 7.6, “ Yum Plug-ins”. For further information on controlling plug-ins, see Section 7.6.1, “ Enabling, Configuring, and Disabling Yum Plug-ins”.

repo sd i r= directory

Here, directory is an absolute path to the directory where . repo files are located. All . repo files contain repository information (similar to the [repository] sections of

/etc/yum. co nf). Yum collects all repository information from . repo files and the

[repository] section of the /etc/yum. co nf file to create a master list of repositories to use for transactions. If repo sd i r is not set, yum uses the default directory

/etc/yum. repo s. d /.

retri es= value

This option sets the number of times yum should attempt to retrieve a file before returning an error. value is an integer 0 or greater. Setting value to 0 makes yum retry forever. The default value is 10.

For a complete list of available [mai n] options, see the [mai n] O P T IO NS section of the yu m.co n f (5) manual page.