6.3. Yum: Yellowdog Updater Modified

 < Day Day Up > 

Yum is a system for managing RPM packages, including installing, updating, removing, and maintaining packages; it automatically handles dependencies between packages. Yum is derived from yup, an updating system written for Yellow Dog Linux, an RPM-based Macintosh distribution. Yum downloads the information in the package headers to a directory on your system, which it then uses to make decisions about what it needs to do. Yum obtains both the headers and the RPMs themselves from a collection of packages on a server, known as a repository.

A repository consists of a set of RPM packages and the package headers on a server that can be accessed via FTP or HTTP, from an NFS server, or from a local filesystem. A single server can contain multiple repositories, repositories are often mirrored on many servers, and you can configure yum to use multiple repositories. When they are downloaded to your system, the header and package files are maintained in /var/cache/yum.

The configuration file, /etc/yum.conf, is where you customize yum. It consists of two section types. The first section, [main], sets configuration defaults for yum operation. This section is followed by [server] sections, where each server is named according to the repository it specifies. For example, for Fedora Core, you might have [base] for the base Fedora Core repository and [development] for the development repository.

The server sections can also be stored, one to a file, in /etc/yum.repos.d. yum comes with a default yum.conf file, which you can use as-is or as a starting point from which to add additional repositories.

6.3.1. The yum Command

The yum command is an automated system for updating rpm-based packages, particularly on Fedora Core and Red Hat Enterprise Linux. Yum can automatically install, upgrade, and remove packages. In addition to individual packages or a list of packages, yum can operate on an entire group of packages at a time.

When you run yum, it first updates the cache (unless you tell it not to with the -C option), then it proceeds to perform the requested operation.

The format of the yum command is:

 yum [options] [command] [package ...]

Any general options are specified first, followed by a command telling yum what you want it to do, usually followed by a list of one or more packages. The command is always required, except with the --help, -h, and --version options.

Package names can be specified in various combinations of name, architecture, version, and release. For example, you could refer to the bash package as bash, bash.i386, bash-3.0, bash-3.0-17, or bash-3.0-17.i386.

6.3.1.1. General options

The following general options can be set on the command line. For those that can also be set in the [main] section of the yum.conf configuration file, the name of the configuration option is given.


-c config-file

Specify the location of the yum configuration file. The file can be specified as a path to a local file or as an HTTP or FTP URL. The default is /etc/yum.conf.


-C

Run entirely from the local cache. Don't download or update headers unless required to complete the requested action.


-d num

Set the debug level to num, which is generally a number between 0 and 10, to specify how much debugging information to print. The configuration option is debuglevel.


--disablerepo= repoid

Disable the repository specified by repoid so yum won't use it for this operation. The configuration option is enabled.


-e num

Set the error level to num, where num is a number, generally between 0 and 10. If the value is 0, print only critical errors. If it is 1, print all errors. Values greater than 1 mean print more errors, if there are any.


--enablerepo= repoid

Enable the specified repository that is marked as disabled (enable=0) in the configuration file. This allows the repository to be used for this operation. The configuration option is enabled.


--exclude= package

Exclude the specified package from updates on all repositories. package can be given as a name or a glob. The configuration option is exclude.


-h, --help

Display a help message and exit.


--installroot= root

Specify an alternative root for package installation. All packages will be installed relative to root. The configuration option is installroot.


--obsoletes

Enable obsoletes processing logic, taking into consideration packages that are obsoleted by other packages in the repository. Only meaningful with the yum update command. The configuration option is obsoletes.


-R min

Set the maximum amount of time in minutes that yum will wait before performing a command.


--rss-filename=filename

Use filename as the output file for the generate-rss command. The configuration option is rss-filename.


-t, --tolerant

Keep going (be tolerant) if there are package errors on the command line. This allows yum to continue processing other packages even if there is a problem with one package (e.g., trying to install a package that is already installed). The configuration option is tolerant.


-y

Assume that the answer to any question is yes. The configuration option is assumeyes.

6.3.2. Yum Command Summary

The individual yum commands are listed here.

check-update

 check-update

Determine if updates are available, without running yum interactively. If any package updates are available, return an exit value of 100 and a list of packages. If there are no updates, return 0.

clean

 clean [options]

Clean up the yum cache directory.

Options


all

Clean everything: headers, packages, metadata, and the cache.


cache

Clean up the cache.


headers

Remove all header files, forcing yum to download new headers the next time it runs.


metadata

Remove the metadata files, which maintain information about the packages such as package name, file size, description, dependencies, etc.


packages

Remove cached packages.

generate-rss

 generate-rss [updates]

Create an rss file that lists changelogs for all packages in the enabled repositories. If updates is specified, the rss file lists only updates that apply to your system.

groupinfo

 groupinfo groups

Like info, but operates on package groups instead of individual packages.

groupinstall

 groupinstall groups

Like install, but operates on package groups instead of individual packages.

grouplist

 grouplist

Generate a list of installed and available groups to standard output. You can use these groups as input parameters to the other group commands, with their names in quotes ("...").

groupremove

 groupremove groups

Like remove, but operates on package groups instead of individual packages.

groupupdate

 groupupdate groups

Like update, but operates on package groups instead of individual packages.

info

 info [options] [packages]

Display version information, a summary, and a description for each package, or for all packages if none is specified. See list for a description of the options.

install

 install packages

Install the latest version of a package or packages, ensuring that all dependencies are met. If no package matches the name as specified, the name is treated as a shell glob and any matches are installed.

list

 list [options] [packages]

Display a list of packages that match the packages specification and that are installed or available for installation.

Options


all

List all installed or available packages.


available

List packages on the repository that are available for installation.


extras

List packages on the system that are not available on any repository in the configuration file.


installed

List installed packages.


obsoletes

List installed packages that are made obsolete by any packages in any repository in the configuration file.


updates

List packages that have updates available for installation.

localinstall

 localinstall packages

Install the specified packages, which reside on the local system, rather than downloading them from a repository.

localupdate

 localupdate packages

Update the specified packages, which reside on the local system, rather than downloading them from a repository.

makecache

 makecache

Download and cache the metadata files from the repository. Once the cache has been built, you can use the -C option to run the commands that use the metadata (check-update, info, list, provides, and search) directly from the cache.

provides

 provides feature1 [feature2 ...]

List packages that are available or installed that provide the specified features. The features can be specified as a name or as a wildcard in file-glob syntax format, and Perl or Python regular expressions can be used.

remove

 remove package1 [package2 ...] erase package1 [package2 ...]

Remove the specified packages from the system. Also remove any packages that depend on the specified packages.

search

 search string1 [string2 ...]

Find packages matching the specified string or strings in the description, summary, packager, or package name fields. Perl or Python regular expressions can be used for the strings. Useful for finding a package if you don't know the name.

update

 update [packages]

With no packages specified, update all installed packages. Otherwise, update the specified packages. In either case, yum makes sure that all dependencies are satisfied. If no package matches, the names specified are assumed to be shell globs and any matches are installed.

With the --obsoletes option, yum includes obsolete processing logic in its calculations.

upgrade

 upgrade [packages]

Equivalent to update --obsoletes.

whatprovides

 whatprovides feature1 [feature2 ...]

Same as provides. See provides for more information.

     < Day Day Up > 


    Unix in a Nutshell
    Unix in a Nutshell, Fourth Edition
    ISBN: 0596100299
    EAN: 2147483647
    Year: 2005
    Pages: 201

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net