How To Install python3-libselinux on Rocky Linux 8

In this tutorial we learn how to install python3-libselinux on Rocky Linux 8. python3-libselinux is SELinux python 3 bindings for libselinux

Introduction

In this tutorial we learn how to install python3-libselinux on Rocky Linux 8.

What is python3-libselinux

The libselinux-python3 package contains python 3 bindings for developing SELinux applications.

We can use yum or dnf to install python3-libselinux on Rocky Linux 8. In this tutorial we discuss both methods but you only need to choose one of method to install python3-libselinux.

Install python3-libselinux on Rocky Linux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

After updating yum database, We can install python3-libselinux using dnf by running the following command:

sudo dnf -y install python3-libselinux

Install python3-libselinux on Rocky Linux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

After updating yum database, We can install python3-libselinux using yum by running the following command:

sudo yum -y install python3-libselinux

How To Uninstall python3-libselinux on Rocky Linux 8

To uninstall only the python3-libselinux package we can use the following command:

sudo dnf remove python3-libselinux

python3-libselinux Package Contents on Rocky Linux 8

/usr/lib/.build-id
/usr/lib/.build-id/90
/usr/lib/.build-id/90/4a9a45ec448def633e50ad2a21e50286a5fede
/usr/lib/.build-id/e7
/usr/lib/.build-id/e7/3ec644d75651c630f4578ddc6d38d6f3ac9994
/usr/lib64/python3.6/site-packages/_selinux.cpython-36m-x86_64-linux-gnu.so
/usr/lib64/python3.6/site-packages/selinux
/usr/lib64/python3.6/site-packages/selinux-2.9-py3.6.egg-info
/usr/lib64/python3.6/site-packages/selinux/__init__.py
/usr/lib64/python3.6/site-packages/selinux/__pycache__
/usr/lib64/python3.6/site-packages/selinux/__pycache__/__init__.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/selinux/__pycache__/__init__.cpython-36.pyc
/usr/lib64/python3.6/site-packages/selinux/audit2why.cpython-36m-x86_64-linux-gnu.so

References

Summary

In this tutorial we learn how to install python3-libselinux on Rocky Linux 8 using yum and dnf.