[Centos7] 安裝 semanage (selinux工具程式)

URL Link //n.sfs.tw/11039

2017-05-07 09:31:54 By 張○○

# semanage
-bash: semanage:命令找不到

安裝 semanage

# yum install semanage

No package semanage available.
Error: Nothing to do

OK,顯然找不到,這時使用yum 的option "provides"

# yum provides semanage
...
base/7/x86_64/filelists_db                                                                                                                                                                  | 6.6 MB  00:00:00
extras/7/x86_64/filelists_db                                                                                                                                                                | 770 kB  00:00:00
mariadb/filelists_db                                                                                                                                                                        |  74 kB  00:00:00
updates/7/x86_64/filelists_db                                                                                                                                                               | 2.9 MB  00:00:00
policycoreutils-python-2.5-8.el7.x86_64 : SELinux policy core python utilities
Repo        : base
Matched from:
Filename    : /usr/sbin/semanage

policycoreutils-python-2.5-9.el7.x86_64 : SELinux policy core python utilities
Repo        : updates
Matched from:
Filename    : /usr/sbin/semanage

policycoreutils-python-2.5-11.el7_3.x86_64 : SELinux policy core python utilities
Repo        : updates
Matched from:
Filename    : /usr/sbin/semanage

可以看到有三個版本,我選擇最新的安裝即可

# yum install policycoreutils-python

參考資料

[1] http://sharadchhetri.com/2014/10/07/semanage-command-found-centos-7-rhel-7/