VMware ESXi and vSphere Cluster Management
YUM Package Manager: Installing, Updating, Searching, and Removing RPM Packages
Learn how to use YUM on RPM-based Linux systems to install, update, search, inspect, and remove packages while safely handling dependencies and transactions.
YUM, short for Yellowdog Updater, Modified, is a command-line package management tool for RPM-based Linux systems. It obtains software from configured repositories, installs packages and dependencies, updates existing software, displays package information, searches available packages, and removes installed packages.
This lesson is intended for users of CentOS, Red Hat Enterprise Linux, older Fedora-based systems, and similar RPM-based distributions. You should know how to run commands in a terminal and have a basic understanding of sudo, software versions, and the Linux distribution you are using.
RPM-Based Linux and YUM
RPM is both a package format and part of the package-management ecosystem used by Red Hat-family distributions. An RPM package is a distributable software unit containing program files, metadata, version information, and architecture information.
Distributions such as CentOS, Red Hat Enterprise Linux, and Fedora use RPM packages. Debian-based distributions use a different package format and commonly use APT instead. Commands and repository configuration therefore differ between RPM-based and Debian-based systems.
YUM manages RPM packages through configured repositories. A repository is a source that provides package files and metadata. YUM reads repository metadata to find compatible versions, determine dependencies, and calculate the changes required for an operation.
| Concept | Meaning | Why It Matters |
|---|---|---|
| RPM package | An installable software unit containing program files and metadata. | It is the package format YUM manages. |
| Repository | A configured source of package files and package metadata. | YUM uses enabled repositories to find software and updates. |
| Dependency | Another package or capability required by a package to install or function. | Missing dependencies can prevent installation or execution. |
| Transaction | The complete set of installations, updates, removals, and dependency changes proposed by YUM. | Reviewing it helps prevent unintended changes. |
| Root privileges | Administrative permissions needed to change installed software. | Commands that modify packages normally require sudo or root access. |
Packages, Repositories, and Dependencies
A package contains more than an executable file. It can include libraries, configuration files, service definitions, documentation, scripts, and metadata such as its name, version, release, architecture, and dependencies.
A dependency is a requirement for another package or capability. For example, an application may require a shared library supplied by a separate package. When you ask YUM to install the application, YUM examines the repository metadata, finds compatible dependency packages, and includes them in the proposed transaction.
The same dependency resolution process applies during updates. YUM checks whether newer package versions are compatible with the installed system and calculates which related packages must also change. The result is presented as a transaction for you to review before changes are made.
YUM Command Structure
yum [OPTIONS] COMMAND [PACKAGE]
| Component | Purpose | Example |
|---|---|---|
yum executable | Starts the YUM package manager. | yum |
| Option | Modifies how YUM behaves. Options are placed after the executable and before or around the command depending on the option. | sudo yum -y install net-tools |
| Command | Specifies the operation, such as install, update, info, search, or remove. | install |
| Package argument | Names the package to inspect or modify. | net-tools |
| Search keyword | Text used to search package names and descriptive metadata. | network |
Administrative package changes normally require root privileges. Use sudo when your account is authorized to administer the system. Read-only operations such as searching and displaying information commonly work without sudo.
Installing a Package
Use install followed by the package name. The following command installs net-tools:
sudo yum install net-tools
YUM contacts enabled repositories, locates net-tools, resolves any required dependencies, downloads the packages, and displays the proposed transaction. Review the package list, versions, download size, and total installed size. Confirm only when the changes are appropriate.
Installing a new package is different from updating an existing package: install requests that the package be added if it is not already installed, while update looks for a newer version of an installed package.
Updating Packages
Update One Package
To update one installed package, replace PACKAGE with its package name:
sudo yum update PACKAGE
YUM checks enabled repositories for a newer compatible version of the named package. It may also update related dependencies if required for a consistent transaction.
Update All Installed Packages
sudo yum update
Without a package name, YUM evaluates all eligible installed packages and proposes a broader system update. A full update may affect many packages, libraries, and dependencies. Review the complete transaction carefully, and consider maintenance windows, backups, service compatibility, and local change-control procedures before confirming on a production system.
Viewing Package Information
Use yum info to inspect package metadata:
yum info net-tools
The output can identify whether a package is installed or available from a repository. Depending on the distribution and repository metadata, it can include the package name, version, release, architecture, repository, summary, description, installation status, size, and related information.
Use this lookup before installation when you need to verify that the package name, version, architecture, and repository are appropriate.
Searching for Packages
If you do not know the exact package name, search using a keyword:
yum search network
YUM can match the keyword against package names, summaries, packager information, and descriptions. Search results help you identify a likely package name before running an installation command.
- Search with a relevant keyword.
- Compare the names and descriptions in the results.
- Inspect a candidate with
yum info PACKAGE. - Install the package only after confirming that it provides the required software.
Removing a Package
Use remove followed by the package name:
sudo yum remove net-tools
YUM calculates which packages can be removed while preserving dependency consistency. If other installed packages depend on net-tools, the proposed transaction may include those packages too. Read the entire removal list before confirming. Cancel the command if a required application, service, or library would also be removed.
| Task | Syntax | Example | Result |
|---|---|---|---|
| Install a package | yum install PACKAGE | sudo yum install net-tools | Adds the package and required dependencies. |
| Update one package | yum update PACKAGE | sudo yum update PACKAGE | Updates the named installed package when a newer compatible version is available. |
| Update all packages | yum update | sudo yum update | Updates all eligible installed packages. |
| Display package information | yum info PACKAGE | yum info net-tools | Displays metadata for an installed or available package. |
| Search for packages | yum search KEYWORD | yum search network | Searches package names and descriptive metadata. |
| Remove a package | yum remove PACKAGE | sudo yum remove net-tools | Removes the package and may remove affected dependent packages. |
A Safe YUM Workflow
- Identify the platform. Confirm that the system is RPM-based and determine whether it provides YUM or DNF.
- Search when necessary. Use
yum search KEYWORDif the exact package name is unknown. - Inspect metadata. Use
yum info PACKAGEto check the package description, version, architecture, repository, and installation status. - Run the requested operation. Use
install, a targetedupdate, a fullupdate, orremove. - Review the transaction. Check every package that will be installed, updated, or removed before confirmation.
- Verify the result. Confirm that the expected command, application, service, or package version is available after the operation.
Use extra caution with full updates and removals. On production systems, review change procedures, service impact, maintenance timing, and rollback or backup options before making changes.
YUM and DNF on Current Systems
Many newer RPM-based distributions use DNF as their underlying package manager. Some environments retain a yum command for compatibility, and that command may invoke DNF behavior behind the scenes. Other systems may provide only dnf.
If the shell reports that yum cannot be found, identify the distribution and version, check whether dnf is available, and follow that distribution's package-management documentation. The commands in this lesson use YUM syntax where YUM is available; do not assume that repository configuration or every option behaves identically on every release.
Troubleshooting YUM
YUM Is Not Installed or Cannot Be Found
The distribution may use DNF, YUM may not be installed, or the executable may not be in the shell's PATH. Identify the Linux distribution and version, check whether dnf is available, and use the supported package-management command.
A Package Cannot Be Found
Check for a misspelled package name, search with a relevant keyword, and inspect enabled repository sources. The package may not be available for the current distribution version or CPU architecture.
Dependency Problems Occur
Read the dependency and conflict details in the transaction output. Common causes include missing packages in enabled repositories, incompatible repository versions, and conflicting installed packages. Avoid forcing the operation without understanding the conflict. Verify repository consistency and package-version compatibility first.
Permission Is Denied
Installing, updating, and removing software generally require administrative privileges. Run the package-changing command with sudo when authorized, or ask a system administrator according to local policy.
Removal Includes Additional Packages
Additional packages are proposed for removal when they depend on the target package. Inspect the complete transaction, cancel it if critical software is listed, and determine whether the dependent software is still needed.
A Full Update Contains Unexpected Changes
A system-wide update evaluates every installed package and its dependency relationships. Review the complete summary. If only one package needs attention, use a targeted command such as sudo yum update PACKAGE instead.
Key Exam Notes
- YUM means Yellowdog Updater, Modified.
- YUM is a command-line package manager for RPM-based Linux systems.
- Repositories provide package files and metadata; dependencies are additional requirements needed by packages.
- YUM resolves dependencies and presents the resulting changes as a transaction.
yum install PACKAGEadds a package, whileyum update PACKAGEupdates an existing installed package.yum updaterequests a system-wide update of eligible installed packages.yum info PACKAGEdisplays package metadata, andyum search KEYWORDhelps find unknown package names.yum remove PACKAGEcan remove dependent packages, so always review the proposed transaction.- Administrative changes normally require root privileges, commonly provided with
sudo. - Newer RPM-based distributions may use DNF while retaining YUM compatibility.
For related package-management concepts, continue with YUM Package Manager.