How to Install Group of Packages Using Yum on CentOS and RHEL

On CentOS/RHEL, you can either install packages individually or install multiple packages in a single operation in a group. Package group contain packages that perform related tasks such as development tools, web server (for example LAMP or LEMP), desktop (a minimal desktop that can as well be employed as a thin client) and many more.

Read Also: 3 Ways to List All Installed Packages in RHEL, CentOS and Fedora

In this guide, we will explain how how to install a group of packages with YUM package manager in CentOS, RHEL and Fedora distributions.

From yum version 3.4.2, the groups command was introduced, and now works on Fedora-19+ and CentOS/RHEL-7+; it brings together all the subcommands for dealing with groups.

To list available available groups from all yum repos, use the list subcommand as follows:

# yum groups list
OR
# yum grouplist
Yum Group Package Listing
Loaded plugins: changelog, fastestmirror
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
 * base: mirrors.linode.com
 * epel: mirror.freethought-internet.co.uk
 * extras: mirrors.linode.com
 * updates: mirrors.linode.com
Available Environment Groups:
   Minimal Install
   Compute Node
   Infrastructure Server
   File and Print Server
   MATE Desktop
   Basic Web Server
   Virtualization Host
   Server with GUI
   GNOME Desktop
   KDE Plasma Workspaces
   Development and Creative Workstation
Available Groups:
   CIFS file server
   Compatibility Libraries
   Console Internet Tools
....

You can see the total number of groups using the summary subcommand:

# yum groups summary
List Total Yum Groups
Loaded plugins: changelog, fastestmirror
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
 * base: mirrors.linode.com
 * epel: mirror.freethought-internet.co.uk
 * extras: mirrors.linode.com
 * updates: mirrors.linode.com
Available Environment Groups: 11
Available Groups: 38
Done

Before you proceed to install a group of packages, you can view the group ID, a short description of the group and the various packages it contains under different categories (mandatory, default and optional packages) using info subcommand.

# yum groups info "Development Tools"
List Group Info and Packages
Loaded plugins: changelog, fastestmirror
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile
 * base: mirrors.linode.com
 * epel: mirror.freethought-internet.co.uk
 * extras: mirrors.linode.com
 * updates: mirrors.linode.com

Group: Development Tools
 Group-Id: development
 Description: A basic development environment.
 Mandatory Packages:
   +autoconf
   +automake
    binutils
   +bison
   +flex
    gcc
   +gcc-c++
    gettext
   +libtool
    make
   +patch
    pkgconfig
    redhat-rpm-config
   +rpm-build
   +rpm-sign
...

To install a group of packages, for instance development tools (basic development environment), use the install subcommand as follows.

# yum groups install "Development Tools"
Install Group of Packages
Loaded plugins: changelog, fastestmirror
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
base                                                                                                                                                 | 3.6 kB  00:00:00     
epel/x86_64/metalink                                                                                                                                 |  23 kB  00:00:00     
epel                                                                                                                                                 | 4.3 kB  00:00:00     
extras                                                                                                                                               | 3.4 kB  00:00:00     
mariadb                                                                                                                                              | 2.9 kB  00:00:00     
updates                                                                                                                                              | 3.4 kB  00:00:00     
(1/4): extras/7/x86_64/primary_db                                                                                                                    | 129 kB  00:00:15     
(2/4): updates/7/x86_64/primary_db                                                                                                                   | 3.6 MB  00:00:15     
(3/4): epel/x86_64/primary_db                                                                                                                        | 6.1 MB  00:00:15     
(4/4): epel/x86_64/updateinfo                                                                                                                        | 838 kB  00:00:15     
Loading mirror speeds from cached hostfile
 * base: mirrors.linode.com
 * epel: mirror.freethought-internet.co.uk
 * extras: mirrors.linode.com
 * updates: mirrors.linode.com
Resolving Dependencies
--> Running transaction check
---> Package autoconf.noarch 0:2.69-11.el7 will be installed
--> Processing Dependency: m4 >= 1.4.14 for package: autoconf-2.69-11.el7.noarch
---> Package automake.noarch 0:1.13.4-3.el7 will be installed
...

To remove a group (which erases all packages in the group from the system), simply use remove subcommand.

# yum groups remove "Development Tools"

You can also mark a group as installed with the command below.

# yum groups mark install "Development Tools"

That’s all for now! You can find more subcommands and their explanations under the groups subsection in the yum man page.

You might also like to read these following articles on Yum package manager.

  1. How to Install and Use ‘yum-utils’ to Maintain Yum and Boost its Performance
  2. 4 Ways to Disable/Lock Certain Package Updates Using Yum Command
  3. How to Fix Yum Error: Database Disk Image is Malformed
  4. How to Use ‘Yum History’ to Find Out Installed or Removed Packages Info

In this guide, we have explained how to install a group of packages with YUM package manager in CentOS, RHEL and Fedora. Use the comment form below to send us your queries or views concerning this article.

Hey TecMint readers,

Exciting news! Every month, our top blog commenters will have the chance to win fantastic rewards, like free Linux eBooks such as RHCE, RHCSA, LFCS, Learn Linux, and Awk, each worth $20!

Learn more about the contest and stand a chance to win by sharing your thoughts below!

Aaron Kili
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

2 Comments

Leave a Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.