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

Overview

Yellowdog Updater, Modified (yum) allows you to easily update, install, and remove RPM packages on your system. It uses repositories to manage RPM packages and resolve dependencies for any packages that you install or uninstall. If you set yum to automatically update your system's RPMs, you no longer need to run updates manually.

Note:

You can configure your system's update schedule in WHM's Update Preferences interface (WHM >> Home >> Server Configuration >> Update Preferences).

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 collection of packages on your local machine or one that you can access remotely via FTP or HTTP. You can use several repositories at the same time with yum.

Note:

The following preconfigured repositories exist on CentOS systems:

  • base
  • updates
  • extras
  • centosplus
  • fastrack

Important:

The system stores yum repositories in the /etc/yum.repos.d/ directory. Usually, each repository owns its own file and can contain 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.

To access a new repository, d ownload the .repo file from the desired third party to the /etc/yum.repos.d/ directory and then run the yum update command. 

Yum in EasyApache 4 

cPanel & WHM ensures that installed packages do not conflict with one another. The cPanel & WHM-provided packages in the EasyApache 4 yum repository use the ea- prefix, or 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.6, you must install the ea-php56-php-soap package. You cannot install only the php-soap package.

Common yum commands

Informational commands

Note:

In the following table, example represents the name of the package that you wish to install. 

CommandDescription
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.
yum listDisplay the package names in a repository.

yum list available

Display all available packages for download and install.

yum list installed

Display all installed packages.

yum list all

Display all installed and available packages.

yum list kernel

Display all installed and available kernel packages.

yum list info

Display information about a package.

Install, update, or remove packages

Note:

In the following table, example represents the name of the package that you wish to install.

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 the example 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 web address.
yum groupinstallInstall all packages in the selected group.
yum groupinstall packagenameInstall the packagename packages.
yum reinstall example

Reinstall the current version of the example package.

Note:

This command replaces any deleted files.

yum erase example

or

yum remove example

Erase the example package and any dependencies.

yum autoremove

Remove any unneeded packages.
yum autoremove exampleRemove the example package and any unneeded packages.
yum updateUpdate all of the packages on your system.
yum update exampleUpdate the example package on your system.
yum upgrade

Upgrade the packages on your system.

Note:

This command also removes any obsolete packages on your system.


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 package_manager_fixcache 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.