yum is a package management command-line tool used in Red Hat-based systems (such as CentOS and Fedora) to install, update, and manage software packages. This cheat sheet covers essential yum commands for package management.
Introduction:
yum simplifies the process of managing software packages on Red Hat-based systems. It handles package installation, updates, removals, and dependency resolution.
Basic Commands:
Command
Description
sudo yum install [package]
Install a specific package.
sudo yum remove [package]
Remove a specific package.
sudo yum update
Update all installed packages to the latest versions.
sudo yum upgrade
Upgrade the entire system, including installed packages.
sudo yum search [keyword]
Search for packages containing the specified keyword.
sudo yum list installed
List all installed packages.
sudo yum info [package]
Display detailed information about a package.
Repository Management:
Command
Description
sudo yum repolist
List enabled repositories.
sudo yum-config-manager --enable [repository]
Enable a repository.
sudo yum-config-manager --disable [repository]
Disable a repository.
sudo yum clean all
Clean the package cache and metadata for all repositories.
sudo yum makecache
Generate the metadata cache used by yum.
Dependency Resolution:
Command
Description
sudo yum deplist [package]
List dependencies for a package.
sudo yum check
Check for and resolve dependency issues.
System Information:
Command
Description
yum list updates
List packages with available updates.
yum history
Display a history of transactions.
yum info yum
Display information about the yum package.
Miscellaneous:
Command
Description
sudo yum clean packages
Remove old package files from the cache.
sudo yum install yum-utils
Install yum-utils package for additional utilities.
sudo yum downgrade [package]
Downgrade a package to a specific version.
sudo yum check-update
Check for available package updates.
Conclusion
yum is a powerful package management tool for Red Hat-based systems, providing a straightforward way to install, update, and manage software packages. This cheat sheet covers essential commands for day-to-day package management tasks. Whether you are a system administrator or a user on a Red Hat-based system, mastering these commands will help you efficiently manage software on your system.