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
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
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"
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"
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.
- How to Install and Use ‘yum-utils’ to Maintain Yum and Boost its Performance
- 4 Ways to Disable/Lock Certain Package Updates Using Yum Command
- How to Fix Yum Error: Database Disk Image is Malformed
- 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.
Really nice article, thanks for your efforts.
@Zuhayer
Many thanks for reading, and for the feedback.