Page tree
Skip to end of metadata
Go to start of metadata

Overview

Yellowdog Updater, Modified (yum) is an automatic updater and package installer or remover. It uses the RPM utility to download and install new software, and update or remove existing software. Yum computes dependencies to decide which packages to install. Yum also eliminates the need for manual updates to maintain groups of machines through RPMs.

What is a yum repository?

A yum repository is a collection of RPMs that you can use to update or download content. A repository is a directory on your local machine or a directory that you can access over a network or Internet through FTP or HTTP. A yum repository allows you to keep your software up-to-date automatically. Yum supports the use of several repositories at the same time.

Notes:

The following preconfigured repositories exist on CentOS systems:

  • base
  • updates
  • extras
  • centosplus
  • fastrack

Important:

The /etc/yum.repos.d/ directory stores repositories. Each repository usually owns its own file and can have one or more configuration blocks that designate the available yum repositories . These files do not require edits, but ensure that yum allows the software that third parties provide. D ownload the .repo file from the desired third party to the /etc/yum.repos.d/ directory and then run the yum update command to make this new software available. 

Yum in EasyApache 4 

cPanel & WHM ensures that packages do not conflict with one another. cPanel & WHM-provided packages in the EasyApache 4 yum repository use the ea- prefix. This refers to a package's namespace. This ensures that the apache2 package never conflicts with another apache2 package and that the user downloads the correct package. 

  • Red Hat Enterprise Linux uses the Software Collections Library (SCL) to maintain various installations when a user installs multiple versions of one package. For more information, read Red Hat's Software Collections and Red Hat documentation.
  • In cPanel & WHM version 66 and later, the MultiPHP system recognizes SCL PHP packages that do not use the ea- prefix. This allows you to use vendor-provided PHP packages. You must use yum to install these packages. 

Note:

Each Software Collection area uses its own package namespace. Because of this, each server includes two package namespaces for each version of PHP. For example, to install the -soap extension for PHP 5.5, you must install the ea-php55-php-soap package. You cannot install only the php-soap package.

Yum list

The yum list command is the most commonly used yum command. The yum list  command displays package names from repositories. The following table lists some common yum list options:

CommandDescription
yum list availableDisplay all available packages for download and install.
yum list installedDisplay all installed packages.
yum list allDisplay all installed and available packages.
yum list kernelDisplay all installed and available kernel packages.
yum list infoDisplay information about a package.

Notes:

You may also wish to use the following additional yum commands:

  • yum info example — Display information about the example package.
  • yum updateinfo — Locate and display information on available updates.
  • yum updateinfo security — Locate and display information on available security updates. 


How to install a package from a repository to your system

The yum install command allows you to install, update, or download packages from a repository to your system. The following table lists some common yum install options:

CommandDescription
yum installInstall a package from a repository to your system.
yum install exampleInstall the example package from a repository to your system.
yum localinstall example

Install a package from a local file, HTTP, or FTP.

Note:

For example:

  • The yum localinstall heb-1-1.t874.rpm command installs the heb package from the local directory.
  • The yum localinstall http://myrepo/heb-1-1.t874.rpm command installs the heb package from the FTP site.
yum groupinstallInstall all packages in the selected group.
yum groupinstall packagenameInstall the packagename packages.

How to reinstall a yum package

To reinstall the current version of a package, run the following command, where example represents the package that you wish to reinstall:

yum reinstall example

Note:

This command replaces any deleted files.

How to erase a yum package

To erase a yum package and its dependencies, run the following command, where example represents the package to erase:

yum erase example

How to remove a yum package

The yum remove command's functionality is similar to the yum erase command's.

To remove a yum package and its dependencies from the system, run the following command, where example represents the package to remove:

yum remove example

The yum autoremove command's functionality is similar to the yum erase command's.

To remove unneeded yum packages, run the following command:

yum autoremove

To remove a specific package with the yum autoremove command, run the following command, where example represents the package to remove:

yum autoremove example 

How to update your server

The yum updateinfo, yum update, and yum upgrade commands locate which packages are available for update or upgrade.

To update your server, perform one or more of the following steps:

  • To update a specific yum package, run the following command, where example represents the package to update:

    yum install example
  • To update your system with all of the latest RPM packages, run the following command:

    yum update
  • To upgrade your system with the latest RPM packages, run the following command:

    yum upgrade

    Note:

    The yum upgrade command's functionality is similar to the yum update command's, but the yum upgrade command also removes obsolete RPM packages.

Troubleshoot the yum cache

EasyApache 4 attempts to resolve any yum cache issues that you may experience.

If you experience issues with the yum cache, run one of the following commands:

If the API call does not return the cache_seems_ok_now value, the system could not resolve the yum error. This usually results from one of the following issues:

  • Network issues with your server or upstream provider.
  • Disk issues, such as bad permissions or free space.
  • An invalid yum configuration.
  • Another error. You must check the error that yum returns and resolve the issue manually.