Common YUM commands for querying software repositories for package information and availability, installation or removal.
Applicable to Centos Versions:
- Centos 5.x
- Centos 6.x
Explanation of requirements.
- An Official Centos install
- Working RPM and Yum
Yum Commands (Yellowdog Update Manager)
Here are a few of the most used yum commands:
- Display your currently installed software repositories enabled or disabled and the status of each:
- Search the currently enabled repos for a specific string (in this case we’re wondering what php packages are available):
- Find out what package a particular file belongs to:
- Find useful information about a package:
- Find the dependencies of a specific package:
- List the software groups available for install:
- Install a specific group of packages:
- Install an RPM downloaded elsewhere using yum to solve dependencies:
- Install a package with yum:
- Remove a package with yum:
- Clean out the yum cache of headers, metadata, downloaded packages, etc (man yum for more info):
- Perform a system-wide update on all packages, including the kernel (note: kernel updates require a reboot to use the new kernel):
- Useful Yum plugins:
yum repolist all
yum search */php
yum list php*
yum provides /usr/bin/ssh
yum info openssh
yum deplist ImageMagick
yum groupinstall "GNOME Desktop Environment"
yum localinstall package.rpm (note: this command assumes you are in the same directory as package.rpm)
yum install php-mysql
yum remove php-mysql
(note: removing a package will also remove its dependencies but not dependencies that are orphaned.)
yum clean all
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 --enablerepo=epel info yumex or yum --enablerepo=rpmforge info yumex 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
Common Problems & Fixes
Description of common problems here, including links to known common problems if located on another site.
Any additional information or notes.
We test this stuff on our own machines, really we do. But you may run into problems, if you do, come to #centoshelp on irc.freenode.net