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<br />yum list php*
yum provides /usr/bin/ssh
yum info openssh
yum deplist ImageMagick
yum groupinstall "GNOME Desktop Environment"
yum localinstall package.rpm
(<em>note: this command assumes you are in the same directory as package.rpm</em>)
yum install php-mysql
yum remove php-mysql <br />(<em>note: removing a package will also remove its dependencies but not dependencies that are orphaned.</em>)
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: <strong>yum info yum-fastestmirror</strong> or <strong>yum --enablerepo=epel info yumex</strong> or <strong>yum --enablerepo=rpmforge info yumex</strong>
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