51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

执行semanage相关操作时提示缺少_selinux.so依赖库

概述

由于前公司同事升级python服务导致依赖丢失,无法正常使用semanage命令。

[root@localhost ~]# semanage port -l
Traceback (most recent call last):
File "/usr/sbin/semanage", line 32, in <module>
import seobject
File "/usr/lib64/python2.7/site-packages/seobject/__init__.py", line 26, in <module>
import selinux
File "/usr/lib64/python2.7/site-packages/selinux/__init__.py", line 26, in <module>
_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
赞(2)
未经允许不得转载:工具盒子 » 执行semanage相关操作时提示缺少_selinux.so依赖库