Yum Commands

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

Requirements

Explanation of requirements.

  1. An Official Centos install
  2. Working RPM and Yum

Yum Commands (Yellowdog Update Manager)

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:
  2. yum repolist all
  3. Search the currently enabled repos for a specific string (in this case we’re wondering what php packages are available):
  4. yum search */php
    yum list php*
  5. Find out what package a particular file belongs to:
  6. yum provides /usr/bin/ssh
  7. Find useful information about a package:
  8. yum info openssh
  9. Find the dependencies of a specific package:
  10. yum deplist ImageMagick
  11. List the software groups available for install:
  12. yum grouplist
  13. Install a specific group of packages:
  14. yum groupinstall "GNOME Desktop Environment"
  15. Install an RPM downloaded elsewhere using yum to solve dependencies:
  16. yum localinstall package.rpm 
    (note: this command assumes you are in the same directory as package.rpm)
  17. Install a package with yum:
  18. yum install php-mysql
  19. Remove a package with yum:
  20. yum remove php-mysql 
    (note: removing a package will also remove its dependencies but not dependencies that are orphaned.)
  21. Clean out the yum cache of headers, metadata, downloaded packages, etc (man yum for more info):
  22. yum clean all
  23. Perform a system-wide update on all packages, including the kernel (note: kernel updates require a reboot to use the new kernel):
  24. yum update
  25. Useful Yum plugins:
  26. 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.

More Information

Any additional information or notes.

Disclaimer

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

Added Reading


© 2012 CentosHelp.org