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
semanage command on system, install
policycoreutils-python package by using
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 /usr/sbin/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: mirror.nbrc.ac.in * extras: mirror.nbrc.ac.in * updates: centosh2.centos.org base/7/x86_64/filelists_db | 5.8 MB 00:00:12 extras/7/x86_64/filelists_db | 54 kB 00:00:00 http://centosh2.centos.org/centos/7.0.1406/updates/x86_64/repodata/f39377219ecae6bf98c525d6a789ac92127f15729685214cd5030c61926c828a-filelists.sqlite.bz2: [Errno 12] Timeout on http://centosh2.centos.org/centos/7.0.1406/updates/x86_64/repodata/f39377219ecae6bf98c525d6a789ac92127f15729685214cd5030c61926c828a-filelists.sqlite.bz2: (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
Most important learning, how we found that semanage require