yum – RPM-Based Package Manager

YUM (Yellowdog Updater, Modified) is a command-line package management utility for RPM-based Linux systems. It is used to install, update, remove, and manage software packages on the system. YUM automatically resolves dependencies between packages and can download and install packages from remote repositories. It is the default package manager for many popular Linux distributions such as CentOS, Fedora, and Red Hat Enterprise Linux.

Overview

YUM commands follow the syntax:

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

Here are some common YUM commands:

Install a package

To install a package, use the following command:

yum install package_name

For example, to install the Apache web server, run:

yum install httpd

Update a package

To update a package, use the following command:

yum update package_name

For example, to update the Apache web server, run:

yum update httpd

Remove a package

To remove a package, use the following command:

yum remove package_name

For example, to remove the Apache web server, run:

yum remove httpd

Search for a package

To search for a package, use the following command:

yum search package_name

For example, to search for the Apache web server, run:

yum search httpd

List installed packages

To list all installed packages, use the following command:

yum list installed

List available packages

To list all available packages in the configured repositories, use the following command:

yum list available

Options

Here are some commonly used options for the YUM command:

Option Description
-y Automatically answer “yes” to all prompts
--enablerepo=repo_name Enable a specific repository
--disablerepo=repo_name Disable a specific repository
--nogpgcheck Disable GPG signature checking
--exclude=package_name Exclude a specific package from the command
--skip-broken Skip packages with unresolved dependencies

Troubleshooting tips

Here are some common issues that may occur when using YUM and how to troubleshoot them:

“No package available” error

If you receive a “No package available” error, it means that the package you are trying to install or update is not available in any of the configured repositories. You can try enabling additional repositories or downloading the package manually and installing it using the rpm command.

Dependency resolution errors

If YUM encounters dependency resolution errors, it means that the package you are trying to install or update requires other packages that are not available in any of the configured repositories. You can try enabling additional repositories or installing the missing packages manually.

GPG signature errors

If YUM encounters GPG signature errors, it means that the package you are trying to install or update is not signed with a trusted GPG key. You can try importing the GPG key manually using the rpm command or disabling GPG signature checking using the --nogpgcheck option.

Notes

  • YUM uses a configuration file located at /etc/yum.conf to specify the repositories, proxy settings, and other options.
  • YUM can also be used with the dnf command, which is a newer package manager that provides better performance and features.
  • YUM can be used to manage both binary and source packages, although source packages require additional configuration.