On Unix-like operating systems, the yum command is an interactive, rpm-based package manager.

Description

yum stands for “Yellowdog Updater Modified”. It can automatically perform system updates, including dependency analysis and obsolete processing based on “repository” metadata. It can also perform installation of new packages, removal of old packages and perform queries on the installed or available packages among other commands/services (see below). The yum command is similar to other high level package managers like apt-get and smart.

  • Description
  • Syntax
  • Command descriptions
  • General options
  • List options
  • Plugins
  • Examples
  • Related commands
  • Linux commands help

Syntax

yum [options] [command] [package …]

command may be one of:

install package1 [package2] […]

update [package1] [package2] […]

update-to [package1] [package2] […]

check-update

upgrade [package1] [package2] […]

upgrade-to [package1] [package2] […]

distribution-synchronization [package1] [package2] […]

remove | erase package1 [package2] […]

list […]

info […]

provides | whatprovides feature1 [feature2] […]

clean [ packages | metadata | expire-cache | rpmdb | plugins | all ]

makecache

groups […]

search string1 [string2] […]

shell [file name]

resolvedep dep1 [dep2] […]

reinstall package1 [package2] […]

downgrade package1 [package2] […]

deplist package1 [package2] […]

repolist [all|enabled|disabled]

version [all|installed|available|group-|nogroups|grouplist|groupinfo]

history [info|list|packages-list|summary|addon-info|redo|undo|rollback|new]

check

help [command]

Unless the –help or -h option is given, one of the above commands must be present.

Command descriptions

General options

Most command line options can be set using the configuration file as well and the descriptions indicate the necessary configuration option to set.

List options

The following are the ways which you can invoke yum in list mode. Note that all list commands include information on the version of the package.

Output

The format of the output of yum list is:

name.arch [epoch:]version-release repo or @installed-from-repo

yum list [all | glob_exp1] [glob_exp2] […]

List all available and installed packages.

yum list available [glob_exp1] […]

List all packages in the yum repositories available to be installed.

yum list updates [glob_exp1] […]

List all packages with updates available in the yum repositories.

yum list installed [glob_exp1] […]

List the packages specified by args. If an argument does not match the name of an available package, it is assumed to be a shell-style glob and any matches are printed.

yum list extras [glob_exp1] […]

List the packages installed on the system that are not available in any yum repository listed in the config file.

yum list obsoletes [glob_exp1] […]

List the packages installed on the system that are obsoleted by packages in any yum repository listed in the config file.

yum list recent

List packages recently added into the repositories. This command is often not helpful, but what you may really want to use is “yum list-updateinfo new” from the security yum plugin.

Specifying package names

A package can be referred to for install, update, remove, list, info etc with any of the following as well as globs of any of the following:

name name.arch name-ver name-ver-rel name-ver-rel.arch name-epoch:ver-rel.arch epoch:name-ver-rel.arch

For example:

yum remove kernel-2.4.1-10.i686

… removes this specific kernel-ver-rel.arch;

or:

yum list available ‘foo*’

… lists all available packages that match ‘foo*’. The single quotes will keep your shell from expanding the globs.

Options

The following are the ways which you can invoke yum in clean mode. Note that “all files” in the commands below means “all files in currently enabled repositories”. If you want to also clean any (temporarily) disabled repositories you need to use –enablerepo=’*’ option.

yum clean expire-cache

Eliminate the local data saying when the metadata and mirrorlists were downloaded for each repository, which means yum will revalidate the cache for each repository next time it is used. However, if the cache is still valid, nothing significant was deleted.

yum clean packages

Eliminate any cached packages from the system. Note that packages are not automatically deleted after they are downloaded.

yum clean headers

Eliminate all of the header files, which old versions of yum used for dependency resolution.

yum clean metadata

Eliminate all of the files which yum uses to determine the remote availability of packages. Using this option will force yum to download all the metadata the next time it is run.

yum clean dbcache

Eliminate the sqlite cache used for faster access to metadata. Using this option will force yum to download the sqlite metadata the next time it is run, or recreate the sqlite metadata if using an older repository.

yum clean rpmdb

Eliminate any cached data from the local rpmdb.

yum clean plugins

Tell any enabled plugins to eliminate their cached data.

yum clean all

Does all of the above.

Plugins

Yum can be extended through the use of plugins. A plugin is a Python “.py” file that is installed in one of the directories specified by the pluginpath option in yum.conf. For a plugin to work, the following conditions must be met:

  • The plugin module file must be installed in the plugin path as just described.
  • The global plugins option in /etc/yum/yum.conf must be set to “1”.
  • A configuration file for the plugin must exist in /etc/yum/pluginconf.d/<plugin_name>.conf and the enabled setting in this file must set to “1”. The minimal content for such a configuration file is:

[main] enabled = 1

Examples

yum search chromium

Search the yum repositories for all packages with the word “chromium” in the title.

yum -y install chromium

Install the package named “chromium”, and assume the answer “y” (yes) to any questions asked during installation.

dpkg — Query, install, remove, and maintain Debian software packages and their dependencies.