How To Install python3-pystemd on CentOS 8

In this tutorial we learn how to install python3-pystemd on CentOS 8. python3-pystemd is A thin Cython-based wrapper on top of libsystemd

Introduction

In this tutorial we learn how to install python3-pystemd on CentOS 8.

What is python3-pystemd

This library allows you to talk to systemd over D-Bus from Python, without actually thinking that you are talking to systemd over D-Bus. This allows you to programmatically start/stop/restart/kill and verify service status from systemd point of view, avoiding subprocessing systemctl and then parsing the output to know the result.

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

Install python3-pystemd on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install python3-pystemd

Install python3-pystemd on CentOS 8 Using dnf

If you don’t have dnf installed you can install DNF on CentOS 7 first. Update yum database with dnf using the following command.

sudo dnf makecache

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

sudo dnf -y install python3-pystemd

How To Uninstall python3-pystemd on CentOS 8

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

sudo dnf remove python3-pystemd

References

Summary

In this tutorial we learn how to install python3-pystemd on CentOS 8 using yum and dnf.