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:

CommandDescription
sudo yum install [package]Install a specific package.
sudo yum remove [package]Remove a specific package.
sudo yum updateUpdate all installed packages to the latest versions.
sudo yum upgradeUpgrade the entire system, including installed packages.
sudo yum search [keyword]Search for packages containing the specified keyword.
sudo yum list installedList all installed packages.
sudo yum info [package]Display detailed information about a package.

Repository Management:

CommandDescription
sudo yum repolistList enabled repositories.
sudo yum-config-manager --enable [repository]Enable a repository.
sudo yum-config-manager --disable [repository]Disable a repository.
sudo yum clean allClean the package cache and metadata for all repositories.
sudo yum makecacheGenerate the metadata cache used by yum.

Dependency Resolution:

CommandDescription
sudo yum deplist [package]List dependencies for a package.
sudo yum checkCheck for and resolve dependency issues.

System Information:

CommandDescription
yum list updatesList packages with available updates.
yum historyDisplay a history of transactions.
yum info yumDisplay information about the yum package.

Miscellaneous:

CommandDescription
sudo yum clean packagesRemove old package files from the cache.
sudo yum install yum-utilsInstall yum-utils package for additional utilities.
sudo yum downgrade [package]Downgrade a package to a specific version.
sudo yum check-updateCheck 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.