Most Linux admins are aware of the yum (Yellow Dog Updater Modified) utility for package management in Red Hat-based distros such as RHEL, CentOS, and Fedora. Few, however, are aware of the power, benefits, and utility of yum groups. In addition to installing individual packages, yum can also install and manage groups of packages through its groupinstall feature, a part of yum groups. By using yum groups, it’s not necessary for you to manually install related packages individually. For example, the yum group “Web Server” not only installs httpd, it also installs crypto-utils, httpd-manual, mod_perl, mod_ssl, mod_wsgi, and webalizer, plus all their dependencies.
The following tutorial is based on CentOS 6.5 and should work with other versions of Red Hat-based distros. Older versions may require that you install yum-utils in order to use yum groups.
A free companion video for this guide is available at http://youtu.be/0ab17Sh-LM0.
Package Management through Groups
In the following steps, you will learn how to list available groups, install a group, and remove a group.
Use the command yum grouplist to see a list of all the available package groups.
Now, add a grep filter to look for groups related to “Web” by using the command yum grouplist | grep Web (Remember, everything in Linux is case-sensitive.)
Use yum groups to install the Web Server group with the following command:
yum groupinstall “Web Server”
(Notice the use of quotation marks around the package name since it consists of two words. Also, notice that the two words are capitalized.) Stand up and stretch while this installation takes place. It has to download and install 34 packages which takes about a minute, depending on your connection speed and your computer’s speed. Do some shoulder rolls and neck rolls while this takes place. Seriously.
When it’s finished, as usual, it will return a command prompt. In the following screen capture, you can see all the packages it installed. Obviously, even with automatic dependency installation, this is still a lot less work than installing the packages manually.
Now, remove the group with the command yum groupremove “Web Server”
As with yum groupinstall, the process of uninstalling packages is much easier with yum groupremove.
An obvious disadvantage to using yum groups is that it installs a lot of packages, some of which you may not need or want. Yum groups, however, is a great way to teach yourself about various packages that you might want to use on a particular type of server. Ultimately, you’ll probably perform customized, manual package installations. During your learning process, yum groups can provide many insights into available packages.
Excerpted from the newly expanded and updated The Accidental Administrator: Linux Server Step-by-Step Configuration Guide, 2nd Edition by Don R. Crawley.