概述
由于前公司同事升级python服务导致依赖丢失,无法正常使用semanage命令。
[root@localhost ~]# semanage port -l
Traceback (most recent call last):
File "/usr/sbin/semanage", line 32, in
import seobject
File "/usr/lib64/python2.7/site-packages/seobject/__init__.py", line 26, in
import selinux
File "/usr/lib64/python2.7/site-packages/selinux/__init__.py", line 26, in
_selinux = swig_import_helper()
File "/usr/lib64/python2.7/site-packages/selinux/__init__.py", line 22, in swig_import_helper
_mod = imp.load_module('_selinux', fp, pathname, description)
ImportError: /usr/lib64/python2.7/site-packages/selinux/_selinux.so: cannot open shared object file: No such file or directory```
解决办法
更新或者重新安装卸载该包
[root@localhost ~]# yum update -y libselinux-python
文章来源于互联网:执行semanage相关操作时提示缺少_selinux.so依赖库