Managing Red Hat packages with yum

REDHATCENTOSLINUXLPIC1-101YUM

2/17/2026

These commands are tested on CentOS 7.

This is the file where the repository is listed.

# less /etc/yum.conf

The repository files under the following directory are also included with the repositories in the file above:

# ls /etc/yum.repos.d/

yum automatically updates repository information when you issues commands, so you don't have to do it manually.

If for some reason, you need to reinstall a package, just change the install subcommand to reinstall. Example: yum reinstall iotop

It will avoid asking for confirmation:

# yum -y install iotop

If it says that the package is "available" it means that it is not installed. Otherwise it will say "Installed":

# yum list iotop

(Verify the package is installed)

Clear the cache:

# yum clean all

Update a package:

# yum update iotop

To update all installed packages on your system use the command yum update with no package specified.

To remove a package:

# yum remove iotop

# yum list iotop

Another way of checking whether a package is installed and having more information about the package:

# yum info iotop

Check the dependencies:

# yum deplist iotop

Determining what file on your system belongs to what package is easy to just use the provides sub command.

# which top

# yum provides /bin/top

(It returns the full name of the package and repository information)

# yum search [pattern]

These commands are tested on CentOS 7, but newer versions use "dnf" instead. For most commands is just replacing "yum" by "dnf".

Action YUM (CentOS 7) DNF (CentOS 8+ / RHEL 8+)

Install yum install iotop dnf install iotop

Remove yum remove iotop dnf remove iotop

Search yum search iotop dnf search iotop

Update yum update dnf update

Clean Cache yum clean all dnf clean all

Info yum info iotop dnf info iotop

More on Red Hat packages here.