8.3. Working with Package Groups

A package group is a collection of packages that serve a common purpose, for instance System Tools or Sound and Video. Installing a package group pulls a set of dependent packages, saving time considerably. The yum groups command is a top-level command that covers all the operations that act on package groups in yum.

8.3.1. Listing Package Groups

The summary option is used to view the number of installed groups, available groups, available environment groups, and both installed and available language groups:
yum groups summary

Example 8.14. Example output of yum groups summary

~]$ yum groups summary 
Loaded plugins: langpacks, product-id, subscription-manager
Available Environment Groups: 12
Installed Groups: 10
Available Groups: 12
To list all package groups from yum repositories add the list option. You can filter the command output by group names.
yum group list glob_expression
Several optional arguments can be passed to this command, including hidden to list also groups not marked as user visible, and ids to list group IDs. You can add language, environment, installed, or available options to reduce the command output to a specific group type.
To list mandatory and optional packages contained in a particular group, use the following command:
yum group info glob_expression

Example 8.15. Viewing information on the LibreOffice package group

 ~]$ yum group info LibreOffice
Loaded plugins: langpacks, product-id, subscription-manager

Group: LibreOffice
 Group-Id: libreoffice
 Description: LibreOffice Productivity Suite
 Mandatory Packages:
  =libreoffice-calc
   libreoffice-draw
  -libreoffice-emailmerge
   libreoffice-graphicfilter
  =libreoffice-impress
  =libreoffice-math
  =libreoffice-writer
  +libreoffice-xsltfilter
 Optional Packages:
   libreoffice-base
   libreoffice-pyuno
As you can see in the above example, the packages included in the package group can have different states that are marked with the following symbols:
  • " - " — Package is not installed and it will not be installed as a part of the package group.
  • " + " — Package is not installed but it will be installed on the next yum upgrade or yum group upgrade.
  • " = " — Package is installed and it was installed as a part of the package group.
  • no symbol — Package is installed but it was installed outside of the package group. This means that the yum group remove will not remove these packages.
These distinctions take place only when the group_command configuration parameter is set to objects, which is the default setting. Set this parameter to a different value if you do not want yum to track if a package was installed as a part of the group or separately, which will make "no symbol" packages equivalent to "=" packages.
You can alter the above package states using the yum group mark command. For example, yum group mark packages marks any given installed packages as members of a specified group. To avoid installation of new packages on group update, use yum group mark blacklist. See the yum(8) man page for more information on capabilities of yum group mark.

Note

You can identify an environmental group with use of the @^ prefix and a package group can be marked with @. When using yum group list, info, install, or remove, pass @group_name to specify a package group, @^group_name to specify an environmental group, or group_name to include both.

8.3.2. Installing a Package Group

Each package group has a name and a group ID (groupid). To list the names of all package groups, and their group IDs, which are displayed in parentheses, type:
yum group list ids 

Example 8.16. Finding name and groupid of a package group

To find the name or ID of a package group, for example a group related to the KDE desktop environment, type:
~]$ yum group list ids kde\*
Available environment groups:
   KDE Plasma Workspaces (kde-desktop-environment)
Done
Some groups are hidden by settings in the configured repositories. For example, on a server, make use of the hidden command option to list hidden groups too:
~]$ yum group list hidden ids kde\*
Loaded plugins: product-id, subscription-manager
Available Groups:
   KDE (kde-desktop)
Done
You can install a package group by passing its full group name, without the groupid part, to the group install command. As root, type:
yum group install "group name"
You can also install by groupid. As root, execute the following command:
yum group install groupid
You can pass the groupid or quoted group name to the install command if you prepend it with an @ symbol, which tells yum that you want to perform group install. As root, type:
yum install @group
Replace group with the groupid or quoted group name. The same logic applies to environmental groups:
yum install @^group

Example 8.17. Four equivalent ways of installing the KDE Desktop group

As mentioned before, you can use four alternative, but equivalent ways to install a package group. For KDE Desktop, the commands look as follows:
~]# yum group install "KDE Desktop"
~]# yum group install kde-desktop
~]# yum install @"KDE Desktop"
~]# yum install @kde-desktop

8.3.3. Removing a Package Group

You can remove a package group using syntax similar to the install syntax, with use of either name of the package group or its id. As root, type:
yum group remove group_name
yum group remove groupid
Also, you can pass the groupid or quoted name to the remove command if you prepend it with an @-symbol, which tells yum that you want to perform group remove. As root, type:
yum remove @group
Replace group with the groupid or quoted group name. Similarly, you can replace an environmental group:
yum remove @^group

Example 8.18. Four equivalent ways of removing the KDE Desktop group

Similarly to install, you can use four alternative, but equivalent ways to remove a package group. For KDE Desktop, the commands look as follows:
~]# yum group remove "KDE Desktop"
~]# yum group remove kde-desktop
~]# yum remove @"KDE Desktop"
~]# yum remove @kde-desktop