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.
- 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:
1 |
yum repolist all |
1 |
yum search */php<br />yum list php* |
1 |
yum provides /usr/bin/ssh |
1 |
yum info openssh |
1 |
yum deplist ImageMagick |
1 |
yum grouplist |
1 |
yum groupinstall "GNOME Desktop Environment" |
1 2 |
yum localinstall package.rpm (<em>note: this command assumes you are in the same directory as package.rpm</em>) |
1 |
yum install php-mysql |
1 |
yum remove php-mysql <br />(<em>note: removing a package will also remove its dependencies but not dependencies that are orphaned.</em>) |
1 |
yum clean all |
1 |
yum update |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
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> 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
Last Modified: 22 Apr, 2020 at 16:29:19