Yum package groups are really useful when installing or removing software. In one command you can install any group of packages. The yum group can be specified by their textual group name or the group id. Some groups only have optional software, in this case you need to change the yum configuration options to ensure that optional software gets installed.
- [Narrator] Managing Packaged Groups is not that different from managing packages. Every Yum group has a group ID in addition to a group name. To get a list of all group names including ID's Type in Yum, space, group, space, list, space, IDS and hit enter. This will show all groups and inside parenthesis, their group ID. The group ID is a more command line friendly name without spaces in it. You can manage groups using the group name or the group ID. If you use a group name and close it in double quotes, since some of them have spaces in 'em.
With the ID there's no need for double quotes. There's four different ways of identifying a group. We can use the group name enclosed in double quotes, in this case Yum Group Install, double quote, Security, space, Tools, double quote. We could also use the group ID. The group I'd of the Security Tools group would be Security dash Tools. So you'd type in Yum, space Group, space Install, space Security, dash Tools. We can also manage groups using Package Tools. If we prefix the group names and ID's with the @ symbol.
So we could type in Yum, space Install, space @, double quote, Security space Tools, double quote. Or Yum, space Install, space @ Security dash Tools using the group ID. Let's install the security tools group using its ID. Type in Sudo, space Yum, space Group, space Install, space Security dash Tools and hit enter. Now type in your password and hit enter again.
Press Y to continue. If you already have the security tools group installed you will get a message that can be confusing. We can see this by pressing the up arrow key a couple of times and running the install again. Just know that when you see this message it means the group is already installed and there's nothing to do. Notice that installing the security tools group installed 3 packages. Now let's list our groups again to verify. Type in Yum, space Group, space List, space IDS and hit enter.
You'll notice out of the installed groups category we now have development tools and security tools. To remove a Yum group we just use the remove sub command. Type in Sudu, space Yum, space Group, space Remove, space Security dash Tools and hit enter. Notice that it only wants to remove one package even though we installed 3. There is no auto remove option for groups like there is for single packages. But we can use Yum, Auto Remove and perpend the group ID with an @ symbol. Press End to cancel.
Type in Sudo, space Yum, space Auto Remove, space @ Security dash Tools and hit enter. This removes all packages in the group. Press Y to continue. To update all packages in a group we can use group update. Since development tools is the only group still installed let's update that. Type in Sudu, space Yum, space Group, space Update, space, and then we'll type in the development tools group ID, which is Development and hit enter.
Press Y to continue. All packages in the development tools group are now updated. Let's install a different group. Get a list with Yum, Group, List. Type in Yum, space Group, space List and hit enter. Near the bottom is the system administration tools group. Let's install that. Type in Sudu, space Yum, space Group, space Install, space System dash Admin, dash Tools and hit enter.
We get an error message saying there isn't any packages in the group. The first thing we need to do is take a closer look at that group. Type in Yum, space Group, space Info, space System, dash Admin, dash Tools and hit enter. Notice there are no mandatory or default packages in this group, only optional packages. Optional packages are not installed by defaults on CentOS 7. To install optional packages we need to make a change to the configuration. The option we need to set is Group, underscore Package, underscore Types.
We need to set it to mandatory, default, and optional. If I use the dash, dash, set Opt option, it will set this configuration item temporarily. If I wanted optional software installed by default I could add it to the slash Yum CONF file. For now just type in Sudo, space Yum, space Group, space Install, space System, dash Admin, dash Tools, just like we did a moment ago. And then let's set the option with dash, dash, set OPT, equals Group, underscore, Package, underscore, Types, equals, Mandatory, comma, Default, comma, Optional and hit enter.
And press Y to continue. Now it will install the optional system administration tools group. Earlier in this chapter we discussed how to get information in packaged groups. In that video we discussed the output of Yum Group Info. In order to manage all packages in a group as a group, they have to be installed as a group. If packages in a group were installed individually before the group was installed it will not be managed as part of the group. We could use Yum, Groups, Mark to rectify this situation.
For more information I'd review the video on getting information on Yum Groups in this course.
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