The yum command in Linux: package manager in CentOS and RHEL

Introduction

In the world of Red Hat-based Linux distributions, such as CentOS and RHEL, package management is a fundamental task to keep the system updated, secure, and functional. One of the most used tools for this purpose is YUM, the Yellowdog Updater Modified. This package manager allows installing, updating, and removing software easily from the command line, automatically resolving dependencies and accessing configured repositories.

What is YUM?

YUM is a high-level package manager that works on top of RPM, the standard package format in Red Hat and its derivatives. Its main function is to read repository configuration files, resolve dependencies, and perform operations such as installation, updating, and removal of packages. Unlike low-level tools like rpm, YUM automatically handles relationships between packages, avoiding conflicts and ensuring the system ends up in a consistent state.

Main Features

  • Automatic dependency resolution.
  • Support for multiple simultaneous repositories.
  • Full system update with a single command.
  • Detailed logging of actions performed in /var/log/yum.log.

Basic YUM Commands

  • yum install package_name: installs the specified package.
  • yum update: updates all installed packages to their latest versions.
  • yum check-update: lists packages that have updates available.
  • yum remove package_name: removes the package and its unnecessary dependencies.
  • yum search word: searches for packages whose description or name contains the word.
  • yum info package_name: shows detailed information about a package.

Practical Examples

  • Install the Apache web server: sudo yum install httpd
  • Update the kernel and other critical components: sudo yum update kernel*
  • Remove a package that is no longer needed: sudo yum remove samba*
  • List all available updates without applying them: sudo yum check-update

Tips and Best Practices

  • Keep repositories configured and up to date to avoid resolution failures.
  • Periodically use yum clean all to free up space in the cache.
  • Review the log file /var/log/yum.log for auditing changes.
  • In production environments, test updates in a staging environment before applying them to critical servers.

Conclusion

YUM remains a key component in the administration of CentOS and RHEL systems, thanks to its ability to manage packages securely and automatically. Knowing its commands and best practices allows administrators to keep their servers up to date, minimize risks, and optimize the time spent on software management. Mastering YUM is therefore an essential skill for any professional working with Red Hat-based distributions.

This post is also available in ESPAÑOL.

Leave a Reply

Your email address will not be published. Required fields are marked *

Esta obra está bajo una Licencia Creative Commons Atribución 4.0 Internacional para Francesc Roig francesc@vivaldi.net .