How to Simplify Linux Package Installation With Yum Groups

1953

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.

  1. Use the command yum grouplist to see a list of all the available package groups.

yum grouplist

  1. 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.)

yum grouplist grep

  1. 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.

yum groupinstall

  1. 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.

yum groupinstall packages

  1. Now, remove the group with the command yum groupremove “Web Server”

yum groupremove

As with yum groupinstall, the process of uninstalling packages is much easier with yumgroupremove.

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.

Don R. Crawley is author of The Accidental Administrator series of books for IT professionals including The Accidental Administrator: Linux Server Step-by-Step Configuration Guide and president of soundtraining.net a Seattle, Washington-based IT publishing and training firm. He is a veteran IT guy with over 40 years’ experience in technology for the workplace. He holds multiple certifications including Linux+ and IPv6 Silver Engineer. He tweets @doncrawley and blogs at www.soundtraining.net/blog. Don can be reached at (206) 988-5858, www.soundtraining.net, or This e-mail address is being protected from spambots. You need JavaScript enabled to view it
.