Packages and services

Command yum

Manage packages in old RHEL/CentOS

Linux · Bash examples · commands run on the selected server

When to use yum

Use yum on distributions where it is the supported repository package manager. On some newer systems the command delegates to a newer backend, so follow the installed version's documentation and transaction output.

Syntax

yum [PARAMETERS] ACTION [PACKAGE...]

Square brackets mark optional arguments; an ellipsis means repetition. Replace example file names, user names and server addresses with your own values.

Common options and arguments

search
Search for packages.
info
View package details.
install
Installing a package with dependencies.

Usage examples

Find package

yum search tmux

Repository packages matching the search term are listed.

View details

yum info tmux

Details about the selected package are displayed.

Install the selected package

sudo yum install tmux

Installation and dependency changes are proposed for confirmation.

Notes and limitations

  • On modern systems, yum may be a compatible interface to DNF; older ones use a separate implementation.
  • Repositories and support for older distributions may be limited. Please review the transaction before confirming.

Common questions and troubleshooting

Should I use yum or dnf?

Use the manager supported by the distribution and release. The command names can be compatibility interfaces, so inspect local documentation.

Why is a package unavailable in the repository?

Its name, supported release or enabled repository set may differ. Check supported sources instead of installing an arbitrary package from an unknown site.

Further help

Options vary by version and distribution. Check the installed documentation with this command: man yum.