Catalog / YUM Package Manager Cheatsheet
YUM Package Manager Cheatsheet
A comprehensive cheat sheet for the YUM package manager, covering essential commands, options, and troubleshooting tips for managing software packages on RPM-based Linux distributions.
Basic Commands
Package Information
|
Displays detailed information about a specific package, including its version, release, size, and description. Example: |
|
Lists all installed packages on the system. Example: |
|
Lists all packages available for installation from the configured repositories. Example: |
|
Lists available updates for installed packages. Example: |
|
Searches for packages based on a keyword in the package name or description. Example: |
|
Finds which package provides a specific file. Example: |
Package Management
|
Installs the specified package and its dependencies. Example: |
|
Updates the specified package to the latest available version. Example: |
|
Updates all installed packages to the latest available versions. Example: |
|
Removes the specified package. Example: |
|
Removes orphaned dependencies that are no longer required. Example: |
|
Displays the history of YUM transactions. Example: |
Repository Management
Repository Configuration
Repository configuration files are located in Example: |
Key attributes in a
|
Repository Commands
|
Lists all enabled repositories. Example: |
|
Displays information about a specific repository. Example: |
|
Enables a specific repository for a single command. Example: |
|
Disables a specific repository for a single command. Example: |
Managing Repository Priorities
You can set priorities for repositories to prefer packages from certain repositories over others. This is done by installing the Example: |
Advanced Usage
Package Groups
|
Installs a group of related packages. Example: |
|
Updates packages within a group. Example: |
|
Lists available package groups. Example: |
|
Removes a group of packages. Example: |
Downgrading Packages
|
Downgrades a package to the previous version. Example: |
|
This command, often used in conjunction with YUM, removes old kernel packages, keeping only the specified number of latest kernels. This helps to free up disk space. Example: Keeping the two latest kernel versions: |
Other Useful Options
|
|
Example: |
Troubleshooting
Common Issues
Problem: Package not found. Solution: Ensure the repository containing the package is enabled. Use |
Problem: Dependency issues. Solution: YUM usually resolves dependencies automatically. If issues persist, try |
Problem: GPG key errors. Solution: Import the correct GPG key for the repository. Find the key URL in the repo file and use |
YUM History
|
Lists all YUM transactions with their IDs. Example: |
|
Shows detailed information about a specific transaction. Example: |
|
Attempts to undo a specific transaction. Example: |
|
Attempts to redo a specific transaction. Example: |