Here are a few of the most used yum commands:
1.Display your currently installed software repositories enabled or disabled and the status of each:
yum repolist all
2.Search the currently enabled repos for a specific string (in this case we're wondering what php packages are available):
yum search */phpyum list php*
3.Find out what package a particular file belongs to:
yum provides /usr/bin/ssh
4.Find useful information about a package:
yum info openssh
5.Find the dependencies of a specific package:
yum deplist ImageMagick
6.List the software groups available for install:
yum grouplist
7.Install a specific group of packages:
yum groupinstall "GNOME Desktop Environment"
8.Install an RPM downloaded elsewhere using yum to solve dependencies:
yum localinstall package.rpm
(note: this command assumes you are in the same directory as package.rpm)
9.Install a package with yum:
yum install php-mysql
10.Remove a package with yum:
yum remove php-mysql
(note: removing a package will also remove its dependencies but not dependencies that are orphaned.)
11.Clean out the yum cache of headers, metadata, downloaded packages, etc (man yum for more info):
yum clean all
12.Perform a system-wide update on all packages, including the kernel (note: kernel updates require a reboot to use the new kernel):
yum update
13.Useful Yum plugins:
To get a description of the function of each plugin and a description of what each plugin is capable of here is an
example command:
yum info yum-fastestmirror or yum --en=epel info yumex or yum --en=rpmforge info yumi
yum
yum-aliases
yum-allowdowngrade
yum-arch
yum-basearchonly
yum-changelog
yum-cron
yum-downloadonly
yumex.noarch
yum-fastestmirror
yum-filter-data
yumi.noarch
yum-kernel-module
yum-kmod
yum-list-data
yum-merge-conf
yum-metadata-parser
yum-priorities
yum-protectbase
yum-protect-packages
yum-refresh-updatesd
yum-security
yum-skip-broken
yum-tsflags
yum-updateonboot
yum-updatesd
yum-upgrade-helper
yum-utils
yum-versionlock