YUM Cheatsheet
#
yum
is a package management utility for RPM-based Linux distributions that helps in managing packages and repositories.
Basic Commands
#
Command/Option | Example | Description |
---|
yum install <package> | yum install httpd | Install a package |
yum remove <package> | yum remove httpd | Remove a package |
yum update | yum update | Update all installed packages |
yum update <package> | yum update httpd | Update a specific package |
yum upgrade | yum upgrade | Upgrade all installed packages |
yum list | yum list | List available and installed packages |
yum list installed | yum list installed | List installed packages |
yum list available | yum list available | List available packages from enabled repositories |
Package Search and Info
#
Command/Option | Example | Description |
---|
yum search <package> | yum search httpd | Search for packages by name or description |
yum info <package> | yum info httpd | Display detailed information about a package |
yum whatprovides <file> | yum whatprovides /usr/sbin/httpd | Find the package that provides a specific file |
Repository Management
#
Command/Option | Example | Description |
---|
yum repolist | yum repolist | List all enabled repositories |
yum-config-manager --add-repo <repo_url> | yum-config-manager --add-repo http://example.com/repo | Add a new repository |
yum-config-manager --disable <repo_id> | yum-config-manager --disable myrepo | Disable a repository |
yum-config-manager --enable <repo_id> | yum-config-manager --enable myrepo | Enable a repository |
Cleaning and Caching
#
Command/Option | Example | Description |
---|
yum clean all | yum clean all | Remove all cached files from enabled repositories |
yum clean packages | yum clean packages | Remove cached package files |
yum clean metadata | yum clean metadata | Remove cached repository metadata |
Transaction and History
#
Command/Option | Example | Description |
---|
yum history | yum history | List the transaction history |
yum history info <transaction_id> | yum history info 3 | Display detailed information about a specific transaction |
yum history undo <transaction_id> | yum history undo 3 | Undo a specific transaction |
Miscellaneous
#
Command/Option | Example | Description |
---|
yum deplist <package> | yum deplist httpd | Display the dependency list for a package |
yum localinstall <package.rpm> | yum localinstall httpd-2.4.6-93.el7.centos.x86_64.rpm | Install a package from a local RPM file |
This cheatsheet covers essential yum
commands and options for package management on RPM-based Linux distributions.