Yum has the concept of package groups. A package group is a collection of software that can be installed or removed all at once. Package groups contain software with related functionality. For instance you can have a group called Development Tools that would hold tools required for doing software development.
- [Instructor] Yum has the concept of package groups. A package group is a pre-configued collection of packages that can be installed or removed all at one time. Package groups serve a common purpose. For instance, there's a group called Development Tools which contains what you would expect, development tools such as compilers and coding tools. To get a list of all Yum groups, we can type in, yum, space, group, space, list, and hit enter. You may want to note that in CentOS 7 we have a subcommand called group. This is fairly new, and older versions of CentOS would have a subcommand called grouplist, spelled as one word.
If you see tutorials using grouplist as one word, just know that it does the same thing as group space list. The output of yum group list shows a couple of categories. Available Environment Groups, Installed Groups, and Available Groups. The Available Environment Groups contains collections of software for OS configurations. We see Minimal Install, Basic Web Server, and Server with GUI, which is what I'm currently running. The Installed Groups is a category of groups that we have installed.
I'm using the VM we created in the course titled, Linux Installation and Overview. In that course, I installed guest editions in VirtualBox, which requires the Development Tools group to be installed. Currently, this is my only installed package group. During system install, there is a lot more environment categories. These are groups that are hidden by default as they are more useful during the installation process. We can still see them after install, but we need to use the hidden option. Type in, yum space group space list space hidden.
And hit enter. Now we can see all the groups, including the hidden ones. With individual packages, we get a list by using yum list. And when we want more information on a package, we use yum info. Similarly, with yum groups, we get a list of groups with yum group list. And to get more info on a group, we use yum group info. Since I have the Development Tools group installed, let's get information on it. Type in yum space group space info space double quote, Development space Tools, double quote, and hit enter.
Because the group name has a space in it, we need to surround it in double quotes. It's spelled with uppercase and lowercase letters, but if you type in lowercase, yum will still find it. The output of yum group info shows three categories again. This time there are Mandatory Packages, Default Packages, and Optional Packages. Depending on your yum configuration, packages in one or more of these categories will be installed by default. In CentOS 7, the mandatory and default packages are installed automatically. A configuration option needs to be changed for the optional software to be installed as well.
The yum group info command lists packages included in the group. Each package name is prefixed by a character. If that character's a hyphen, then the package is not installed and will not be installed as part of the group. If that character is a plus, then the package is not installed, but will be installed on the next yum upgrade, or yum group upgrade. If that character is an equals sign, then the package was installed as part of the group. If, however, there is blank space in this position, the package is installed but was not installed as part of the group.
In this example, autoconf, automake, bison, flex, gcc, gcc - c++, and libtool are all prefixed by an equals sign, so they were installed as part of the group. Binutils is prefixed by a plus, so it will be installed on the next yum group upgrade. Gettext and make were installed manually, and will not be managed as part of the group. Looking at the output of yum group info, we can see that about half of the mandatory packages are prefixed by an equals sign, meaning they were installed as part of the group.
The other half are indented one character, so they were installed individually. Note that only the packages prefixed by a plus or an equals sign will be managed as a group. Packages that were installed manually will not be. If you wanted those packages managed as a group, you could uninstall them individually and then reinstall their group. Those packages would then be installed and managed as a group from that point on. Another way to manage all packages in the group is to use the yum groups mark subcommand. Let's mark the packages in the development group as installed with a group.
Type in, sudo space yum space groups, that's plural, space mark space install space double quote, Development space Tools, double quote. And hit enter. Type in your password and hit enter again. Now let's convert the old style yum group list to objects, which is how yum works in CentOS 7. Type in sudo space yum space groups, that's plural again, space mark space convert space double quote, Development space Tools, double quote, and hit enter.
And finally, let's do a yum group info development tools to see the difference. Type in, yum space group space info space double quote, Development space Tools, double quote, and hit enter. So we can now see that all of the mandatory and default packages are prefixed by an equals sign, so they will be managed together as a group.
Instructor Grant McWilliams covers network and internet services administration, kernel management, and intrusion prevention. He shows how to make your systems more efficient with virtualization, manage users and groups, and lock everything down with SELinux mandatory access control. Plus, get access to 25 PDF "cheat sheets" and 100 practice questions so you can solidify and test your knowledge.
- Installing Linux on a physical machine
- Managing systemd services
- Managing reoccurring jobs with cron
- Limiting system access
- Configuring networking
- Creating, editing, and moving files and directories
- Analyzing text with grep and regular expressions
- Installing software and packages
- Managing the kernel
- Managing users, accounts, and groups
- Setting permissions
- Using access control lists
- Securing Linux with SELinux
- Accessing Linux remotely
- Configuring local storage