Solution : semanage command not found

This time again I stuck with -bash: semanage: command not found on CentOS 7 and RHEL 7 (Red Hat Enterprise Linux 7) . I mostly use the minimal installed CentOS/RHEL Servers. I got the same issue with semanage command not found on CentOS 6/RHEL 6

Quick Introduction: semanage

semanage is SELinux Policy Management tool.

Fix: semanage command not found

To get semanage command on system, install policycoreutils-python package by using yum command.

yum install policycoreutils-python

And I hope , it will be installed without any problem.

Verify semanage Command Availability

After installation check the semanage command. For more confirmation you can use which command.It will show absolute path of semanage command.

[root@localhost ~]# which semanage
[root@localhost ~]#

How We Got To Know policycoreutils-python Requirement For semanage Command

Basically you should know , why I selected only policycoreutils-python to be installed. I have written about this already in my previous post. would like to suggest this post – yum : how to find rpm package which has certain command or file

[root@localhost ~]# yum provides semanage
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base:
 * extras:
 * updates:
base/7/x86_64/filelists_db                                                                                                | 5.8 MB  00:00:12     
extras/7/x86_64/filelists_db                                                                                              |  54 kB  00:00:00 [Errno 12] Timeout on (28, 'Operation too slow. Less than 1000 bytes/sec transferred the last 30 seconds')
Trying other mirror.
updates/7/x86_64/filelists_db                                                                                             | 2.1 MB  00:00:04     
policycoreutils-python-2.2.5-11.el7.x86_64 : SELinux policy core python utilities
Repo        : base
Matched from:
Filename    : /usr/sbin/semanage
policycoreutils-python-2.2.5-11.el7_0.1.x86_64 : SELinux policy core python utilities
Repo        : updates
Matched from:
Filename    : /usr/sbin/semanage
[root@localhost ~]#


In this article, we have learned that how to fix the semanage command by installing the policycoreutils-python package.

Most important learning, how we found that semanage require policycoreutils-python package.

2 thoughts on “Solution : semanage command not found”

  1. Hey buddy, I’ve found very useful info right here in your site. First time I tested a minimal installation, I was fighting with SELinux config and then I came up with your site. Congratulations for your efforts; you have made happy a sysadmin in Mexico. Regards!!

Comments are closed.