semanage (SELinux Policy Management Tool) is used to configure certain parts of SELinux policy without requiring modification to or recompilation from policy sources.
This post will help you to install the necessary packages for getting semanage command.
Let’s see which package provides us the semanage command using the YUM command.
yum whatprovides semanage
OR
yum provides *bin/semanage
Output:
Updating Subscription Management repositories.
Red Hat Enterprise Linux 8 for x86_64 - AppStream (RPMs) 1.4 MB/s | 7.6 MB 00:05
Red Hat Enterprise Linux 8 for x86_64 - BaseOS (RPMs) 1.3 MB/s | 4.7 MB 00:03
Last metadata expiration check: 0:00:05 ago on Wed 17 Jul 2019 06:34:12 AM EDT.
policycoreutils-python-utils-2.8-16.1.el8.noarch : SELinux policy core python utilities
Repo : rhel-8-for-x86_64-baseos-rpms
Matched from:
Filename : /usr/sbin/semanage
The above output tells you that policycoreutils-python-utils package provides you the semanage command.
Now, install the policycoreutils-python-utils package using the YUM command.
yum install -y policycoreutils-python-utils
Output:
Updating Subscription Management repositories. Last metadata expiration check: 0:01:39 ago on Wed 17 Jul 2019 06:34:12 AM EDT. Dependencies resolved. ================================================================================================================== Package Arch Version Repository Size ================================================================================================================== Installing: policycoreutils-python-utils noarch 2.8-16.1.el8 rhel-8-for-x86_64-baseos-rpms 228 k Installing dependencies: python3-policycoreutils noarch 2.8-16.1.el8 rhel-8-for-x86_64-baseos-rpms 2.2 M python3-libsemanage x86_64 2.8-5.el8 rhel-8-for-x86_64-baseos-rpms 127 k python3-setools x86_64 4.2.0-2.el8 rhel-8-for-x86_64-baseos-rpms 598 k checkpolicy x86_64 2.8-2.el8 rhel-8-for-x86_64-baseos-rpms 338 k python3-audit x86_64 3.0-0.10.20180831git0047a6c.el8 rhel-8-for-x86_64-baseos-rpms 85 k Transaction Summary ================================================================================================================== Install 6 Packages Total download size: 3.6 M Installed size: 9.9 M Downloading Packages: (1/6): python3-setools-4.2.0-2.el8.x86_64.rpm 372 kB/s | 598 kB 00:01 (2/6): python3-libsemanage-2.8-5.el8.x86_64.rpm 69 kB/s | 127 kB 00:01 (3/6): python3-policycoreutils-2.8-16.1.el8.noarch.rpm 1.1 MB/s | 2.2 MB 00:02 (4/6): python3-audit-3.0-0.10.20180831git0047a6c.el8.x86_64.rpm 170 kB/s | 85 kB 00:00 (5/6): checkpolicy-2.8-2.el8.x86_64.rpm 437 kB/s | 338 kB 00:00 (6/6): policycoreutils-python-utils-2.8-16.1.el8.noarch.rpm 691 kB/s | 228 kB 00:00 ------------------------------------------------------------------------------------------------------------------ Total 1.5 MB/s | 3.6 MB 00:02 Running transaction check Transaction check succeeded. Running transaction test Transaction test succeeded. Running transaction Preparing : 1/1 Installing : python3-audit-3.0-0.10.20180831git0047a6c.el8.x86_64 1/6 Installing : checkpolicy-2.8-2.el8.x86_64 2/6 Installing : python3-setools-4.2.0-2.el8.x86_64 3/6 Installing : python3-libsemanage-2.8-5.el8.x86_64 4/6 Installing : python3-policycoreutils-2.8-16.1.el8.noarch 5/6 Installing : policycoreutils-python-utils-2.8-16.1.el8.noarch 6/6 Running scriptlet: policycoreutils-python-utils-2.8-16.1.el8.noarch 6/6 Verifying : python3-policycoreutils-2.8-16.1.el8.noarch 1/6 Verifying : python3-libsemanage-2.8-5.el8.x86_64 2/6 Verifying : python3-setools-4.2.0-2.el8.x86_64 3/6 Verifying : checkpolicy-2.8-2.el8.x86_64 4/6 Verifying : python3-audit-3.0-0.10.20180831git0047a6c.el8.x86_64 5/6 Verifying : policycoreutils-python-utils-2.8-16.1.el8.noarch 6/6 Installed products updated. Installed: policycoreutils-python-utils-2.8-16.1.el8.noarch python3-policycoreutils-2.8-16.1.el8.noarch python3-libsemanage-2.8-5.el8.x86_64 python3-setools-4.2.0-2.el8.x86_64 checkpolicy-2.8-2.el8.x86_64 python3-audit-3.0-0.10.20180831git0047a6c.el8.x86_64 Complete!
Once the installation is complete, run the semanage to see whether it is available or not.
semanage -h
That’s All.