yum Cheat Sheet

yum is a package manager for the Red Hat Enterprise Linux (RHEL) and CentOS Linux distributions. It is used for installing, updating, and managing software packages. Below is a cheat sheet with commonly used yum commands:

Package Management

Install a Package:

sudo yum install package_name

Install Multiple Packages:

sudo yum install package1 package2 package3

Remove a Package:

sudo yum remove package_name

Search for a Package:

yum search package_name

Update and Upgrade

Update System Packages:

sudo yum update

Update a Specific Package:

sudo yum update package_name

Upgrade System (including kernel):

sudo yum upgrade

Repository Management

List Enabled Repositories:

yum repolist

List All Repositories (enabled and disabled):

yum repolist all

Enable a Repository:

sudo yum-config-manager --enable repository_name

Disable a Repository:

sudo yum-config-manager --disable repository_name

Clean Cache and Packages

Clean Package Cache:

sudo yum clean packages

Clean Metadata:

sudo yum clean metadata

Clean All:

sudo yum clean all

Miscellaneous

Check for Updates:

sudo yum check-update

Display Information about a Package:

yum info package_name

List Installed Packages:

yum list installed

List Available Updates:

yum list updates

Check for Dependency Issues:

sudo yum check

Group Operations

Install a Package Group:

sudo yum groupinstall "Group Name"

Remove a Package Group:

sudo yum groupremove "Group Name"

Configuration

Edit Yum Configuration:

sudo nano /etc/yum.conf

Edit Repository Configuration:

sudo nano /etc/yum.repos.d/repository_name.repo

This cheat sheet covers some basic yum commands for package management, repository management, and system updates. Be sure to replace placeholders such as package_name and repository_name with actual package names or repository names.