YUM Package Manager for RPM-Based Linux
Learn how to use YUM on RPM-based Linux systems to install, update, search, inspect, and remove software packages while managing dependencies and repositories.
YUM, short for Yellowdog Updater, Modified, is a command-line package manager for RPM-based Linux distributions. It obtains, installs, updates, queries, and removes software packages by using configured software repositories.
YUM is commonly associated with CentOS, Red Hat Enterprise Linux (RHEL), Fedora-era systems, and compatible distributions. Many newer Fedora and RHEL-family releases use DNF as the primary package manager. On some systems, yum remains available as a compatibility command or refers to the earlier-generation tool. This lesson focuses on the traditional yum command and its workflows.
YUM, RPM, and Software Repositories
RPM is both a package format and a package-management system used by Red Hat-family Linux distributions. An RPM package is a distributable unit of software containing program files, metadata, and installation instructions.
YUM is a higher-level tool built around RPM. RPM can install a local package file, but it does not normally locate that package in repositories or automatically find all required packages. YUM uses repository metadata to locate suitable RPM packages, resolve dependencies, and coordinate the complete operation.
A repository is a configured source of packages and package metadata. Repository metadata describes package names, versions, architectures, summaries, dependencies, and availability. YUM can use enabled repositories to find software and determine which supporting packages are required.
| Term | Meaning | Why it matters when using YUM |
|---|---|---|
| RPM | A package format and package-management system. | YUM installs and manages RPM packages. |
| Repository | A configured source of packages and metadata. | YUM can install only packages available through accessible, enabled repositories or other supported sources. |
| Dependency | Another package or capability required by software. | YUM discovers and includes required libraries and supporting packages when available. |
| Transaction | The complete planned set of package changes. | Review the proposed installations, updates, and removals before confirming. |
| Metadata | Information describing packages, versions, architectures, and dependencies. | YUM queries metadata to search for packages and resolve dependencies. |
| Root privileges | Administrative permissions for changing system software. | Install, update, and remove operations generally require sudo. |
YUM Command Structure and Permissions
The general command form is:
yum [OPTIONS] COMMAND [PACKAGE-OR-KEYWORD]
- Options modify YUM's behavior and are usually placed before or around the command, depending on the version.
- Commands are actions such as
install,update,info,search,list, andremove. - Package names identify software to install, update, inspect, or remove.
- Search keywords are words or phrases used to find packages when the exact name is unknown.
Package-changing actions generally need administrator privileges. Use sudo when your account is authorized to administer the system. Query operations, such as searching or viewing package information, can often run without elevated privileges.
sudo yum install PACKAGE
yum info PACKAGE
Installing Packages with YUM
Use yum install followed by one or more package names:
sudo yum install net-tools
YUM checks enabled repositories, selects a suitable version, resolves required dependencies, and presents a transaction summary. The summary can include the requested package, supporting libraries, download sizes, and the total installation size. Review it carefully, then enter y at the confirmation prompt to continue or n to cancel.
For example, installing a networking utility may produce a transaction containing net-tools and packages it requires. Dependency resolution means that required libraries and supporting packages are selected automatically when they are available in enabled repositories.
You can install several named packages in one transaction:
sudo yum install curl wget
Updating Packages and the System
To update one installed package when a newer version is available, specify its name:
sudo yum update net-tools
To update all installed packages for which updates are available, omit the package name:
sudo yum update
A full system update can be a large transaction. It may add, replace, or remove dependent packages as package relationships change. Always read the proposed transaction before confirming, especially on production systems.
Viewing Package Information
Use yum info to inspect package metadata without installing or updating the package:
yum info net-tools
Output commonly includes the package name, version, release, architecture, repository, installation status, summary, description, and download or installed size. This helps you distinguish an installed package from a package that is merely available through a repository.
Searching for Packages
When you know what a package should do but not its exact name, search repository metadata:
yum search network tools
Search terms can match package names, summaries, descriptions, and related metadata. Use the results to identify the exact package name, then inspect it before installing:
yum search network tools
yum info PACKAGE
sudo yum install PACKAGE
Package listing is also useful for discovery:
yum list installed
yum list available
yum list installedlists packages currently installed on the system.yum list availablelists packages available through enabled repositories.
Removing Packages
Use yum remove to uninstall a package. The example below removes the networking package installed earlier:
sudo yum remove net-tools
YUM displays the removal transaction before asking for confirmation. Review the complete list carefully. Other installed software may depend on the package, so removal can propose removing additional packages. Cancel the transaction if critical or unexpected software appears in the list.
How Dependency and Repository Resolution Works
A dependency is a package or capability that software requires to install or operate correctly. For example, an application may require a shared library. YUM examines package metadata, finds a compatible provider in an enabled repository, and adds that provider to the transaction.
Package availability depends on enabled repositories, current metadata, network access, and repository configuration. A package can exist but still be unavailable to YUM if the appropriate repository is disabled, inaccessible, or does not support the system's release and architecture.
The basic workflow is:
- You enter a YUM command.
- YUM queries enabled repository metadata.
- YUM finds the requested package or search matches.
- YUM resolves dependencies and prepares a transaction.
- You review and confirm the proposed changes.
- YUM downloads and installs, updates, or removes the selected RPM packages.
Essential YUM Commands
| Task | Command pattern | Example | What it does |
|---|---|---|---|
| Install a package | sudo yum install PACKAGE | sudo yum install net-tools | Installs the named package and available required dependencies. |
| Update one package | sudo yum update PACKAGE | sudo yum update net-tools | Updates one installed package when a newer version is available. |
| Update the system | sudo yum update | sudo yum update | Updates all eligible installed packages. |
| Show package information | yum info PACKAGE | yum info net-tools | Displays package metadata and installation status. |
| Search for packages | yum search KEYWORD | yum search network tools | Searches package names and descriptive metadata. |
| Remove a package | sudo yum remove PACKAGE | sudo yum remove net-tools | Prepares a package-removal transaction for review and confirmation. |
Troubleshooting Common YUM Problems
No package matches the requested name
This usually means the name is misspelled, the package is not supplied by enabled repositories, or repository metadata is stale. Search with broader terms and inspect available packages:
yum search KEYWORD
yum list available
Also verify that the appropriate repositories are enabled.
Permission denied
Install, update, and remove commands change system software and normally require root privileges. Retry with sudo and confirm that your user is authorized to use it:
sudo yum install PACKAGE
Repository metadata or package download failure
Check network connectivity and DNS name resolution. A repository server may be unavailable, or proxy and repository configuration may be incorrect. Check the enabled repositories, correct the connectivity or configuration problem, and retry.
Unexpected packages proposed for removal
Other installed packages may depend on the package being removed. Read the entire transaction summary, cancel if critical packages would be removed, and investigate reverse dependencies before proceeding.
Modern distribution uses DNF
Some current distributions use DNF, a newer package-management tool closely related to the YUM workflow. The yum command may be a compatibility wrapper or may not be installed. Check whether dnf is the supported command for the distribution and use its equivalent syntax where appropriate.
Safe YUM Habits
- Use
yum searchwhen you do not know the exact package name. - Use
yum infoto inspect a package before changing the system. - Review every transaction, especially full updates and removals.
- Use repositories appropriate for the distribution release and architecture.
- Do not ignore dependency or repository errors; they can indicate configuration or compatibility problems.
- Use
sudoonly for commands that need administrative privileges.
For supporting shell concepts, review Bash, Linux file ownership, and the main Linux guide.