The `yum` (Yellowdog Updater, Modified) command is a package management utility for RPM-based Linux distributions, including Red Hat Enterprise Linux (RHEL), CentOS, and Fedora (up to Fedora 21). It simplifies the process of installing, updating, removing, and managing software packages on these systems.
**Core Functionality:**
1. **Package Management**: `yum` handles the installation, updating, and removal of software packages, automatically resolving dependencies to ensure that all required components are properly installed.
2. **Repository Management**: It works with repositories (collections of packages) that can be local or remote, allowing administrators to control which sources are used for software packages.
3. **Package Queries**: `yum` provides powerful querying capabilities to search for packages, display package information, and determine which packages provide specific files or features.
4. **Transaction History**: The tool maintains a history of transactions, enabling administrators to review past actions and even undo or redo them if necessary.
**Key Features:**
1. **Dependency Resolution**: One of `yum`'s most important features is its ability to automatically resolve dependencies, ensuring that all required packages are installed along with the requested software.
2. **Group Management**: Packages can be organized into logical groups (such as "Development Tools" or "Web Server"), allowing for easier installation of related packages.
3. **Plugin Architecture**: `yum` supports plugins that extend its functionality, such as automatic updates (`yum-cron`), download-only options (`downloadonly`), and priority settings (`priorities`).
4. **Repository Prioritization**: Administrators can assign priorities to different repositories, controlling which sources are preferred when multiple repositories provide the same package.
5. **Delta RPMs**: When enabled, `yum` can download only the differences between the installed and updated versions of packages, saving bandwidth and time.
6. **Package Verification**: `yum` can verify the integrity and authenticity of packages using GPG signatures, helping to ensure that only trusted software is installed.
**Configuration:**
1. **Main Configuration**: The primary configuration file is `/etc/yum.conf`, which contains global settings for `yum`.
2. **Repository Definitions**: Repository definitions are typically stored in files within the `/etc/yum.repos.d/` directory, with each file defining one or more repositories.
3. **Variables**: `yum` supports variables such as `$releasever` and `$basearch` that dynamically adjust repository URLs based on the system's release version and architecture.
4. **Plugins Configuration**: Plugins may have their own configuration files, usually located in `/etc/yum/pluginconf.d/`.
**Common Usage Scenarios:**
1. **System Updates**: Regular system maintenance typically involves using `yum update` to keep all installed packages up to date with the latest security patches and bug fixes.
2. **Software Installation**: `yum install` is used to add new software to the system, with `yum` handling all the necessary dependencies.
3. **Package Queries**: System administrators often use `yum`'s search, info, and provides commands to locate packages and determine which packages contain specific files or features.
4. **Troubleshooting**: Commands like `yum history`, `yum deplist`, and `yum verify` are valuable for diagnosing and resolving package-related issues.
5. **System Provisioning**: In automated deployment scenarios, `yum` commands are often included in scripts or configuration management tools to ensure consistent software installation across multiple systems.
**Advanced Features:**
1. **Transaction Management**: `yum` operations are performed as transactions, ensuring that package changes are applied atomically. If an error occurs, the transaction can be rolled back to prevent partial updates.
2. **Protected Packages**: Critical system packages can be protected from accidental removal using the `installonlypkgs` and `protect` settings.
3. **Multiple Package Repositories**: `yum` can work with multiple repositories simultaneously, including official distribution repositories, third-party repositories, and private internal repositories.
4. **Version Locking**: The `versionlock` plugin allows administrators to lock specific packages to particular versions, preventing them from being upgraded.
5. **Parallel Downloads**: `yum` can download multiple packages in parallel, improving performance on systems with good network connectivity.
**Limitations and Considerations:**
1. **Performance**: `yum` can be slower than some other package managers, particularly when processing metadata for large repositories.
2. **Memory Usage**: Processing large repositories can require significant memory, which may be a constraint on systems with limited resources.
3. **Network Dependency**: By default, `yum` requires network access to repositories unless a local mirror or the `--cacheonly` option is used.
4. **Root Privileges**: Most `yum` operations require root privileges, though certain query operations can be performed by regular users.
**Historical Context and Future:**
Yum was developed as an improvement over the earlier `up2date` package manager used in Red Hat Linux. Its name stands for "Yellowdog Updater, Modified," as it was based on the YUP (Yellowdog Updater) tool developed for Yellow Dog Linux.
In newer versions of Fedora (Fedora 22 and later), RHEL 8, and CentOS 8, `yum` has been replaced by `dnf` (Dandified YUM), which maintains compatibility with `yum` commands while addressing some of its limitations. In these systems, the `yum` command is often actually a compatibility layer over `dnf`.
**Related Tools:**
1. **rpm**: The lower-level package manager that `yum` is built upon. `rpm` handles individual package operations but doesn't resolve dependencies automatically.
2. **dnf**: The successor to `yum`, offering improved performance, memory usage, and dependency resolution.
3. **createrepo**: A tool for creating `yum` repositories from collections of RPM packages.
4. **repoquery**: A powerful query tool for `yum` repositories (now integrated into `dnf` as `dnf repoquery`).
5. **subscription-manager**: In Red Hat systems, this tool manages subscriptions and entitlements that control access to repositories.
Despite being superseded by `dnf` in newer distributions, `yum` remains an essential tool for managing software on many existing RPM-based Linux systems, particularly in enterprise environments where older, stable distributions are commonly used.