CentOS7 中安装semanage来设置selinux

semanage可以查看和配置selinux,但是,semanage在CentOS上是默认不安装的

直接使用yum install -y semanage来安装

$ yum install semanage
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
No package semanage available.
Error: Nothing to do

如果出现No package semanage available.说明源中没有这个包,可以用yum provides semanage安装

$ yum provides semanage
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
base/7/x86_64/filelists_db                                                                                                                                                                                  | 7.1 MB  00:00:00     
docker-ce-stable/x86_64/filelists_db                                                                                                                                                                        |  20 kB  00:00:00     
epel/x86_64/filelists_db                                                                                                                                                                                    |  12 MB  00:00:00     
extras/7/x86_64/filelists_db                                                                                                                                                                                | 205 kB  00:00:00     
packages-microsoft-com-prod/filelists_db                                                                                                                                                                    | 3.1 MB  00:00:00     
updates/7/x86_64/filelists_db                                                                                                                                                                               | 1.3 MB  00:00:00     
policycoreutils-python-2.5-34.el7.x86_64 : SELinux policy core python utilities
Repo        : base
Matched from:
Filename    : /usr/sbin/semanage

如果还不能使用semanage,刚再输入

yum -y install policycoreutils-python.x86_64
0%