Книга: Fedora™ Unleashed, 2008 edition

Configuring yum

Configuring yum

As mentioned earlier, yum is primarily controlled by the contents of the yum.conf file and the /etc/yum.repos.d directory. Let's take a closer look at the contents of both of these so that you can get a better understanding of how best to configure yum.

When you initially install Fedora, a default yum.conf file provides several switches for the yum command. It basically saves you from having to type in a number of switches and keeps yum simple. By default, yum is configured to do the following:

? Keep a cache of headers in /var/cache/yum

? Give minimal onscreen information during processing

? Keep a log file in /var/log/yum.log

? Download only the most up-to-date packages

? Be tolerant of errors in the process

? Match packages to your processor architecture

? Have a maximum retry limit of 20 times

? Check for obsolete packages

? Use GPG keys to ensure the identities of packages

All these options are contained within the yum.conf file, letting you easily modify or even remove certain lines. For instance, you might need yum to try only a maximum of five times, or you might need yum to give you more visual information.

You can add repository information into the yum.conf file, but an easier way to handle repos is to use the /etc/yum.repos.d folder. This folder enables you to create individual configuration files for each repository. By default, Fedora comes with repositories for their base packages, updated packages, updated packages that are in testing, and the more unstable development packages. Only the base and updated packages are enabled by default.

CAUTION

Unless you really know what you are doing, avoid the more unstable repositories of fedora-updates-testing and fedora-development. These repositories contain bleeding-edge packages that can break your system. You have been warned!

Opening a repository file shows you some details about the repository itself, including the path to it (either via HTTP, FTP, or local access), any lists of mirrors for that repository, whether that repository is enabled, and whether GPG checking is enabled.

If you want to add a new repository, you need to find out a few things before you can successfully add it to either its own repository file under /etc/yum.repos.d or in the yum.conf file.

You can also configure yum to ignore or exclude updates to certain packages. So, for instance, if you have a graphics driver that works only with a specific kernel version and you do not want to have to fix it every time a new kernel is released, you can elect for yum to exclude any kernel updates. Within the yum.conf file, you need to add a line within the top section similar to this:

exclude=kernel

This tells yum to ignore any packages that start with kernel, and should limit the amount of repair work you have to do when a new kernel version is installed.

Оглавление книги


Генерация: 1.465. Запросов К БД/Cache: 3 / 0
поделиться
Вверх Вниз