How To Install python3-libvirt on Rocky Linux 8

In this tutorial we learn how to install python3-libvirt on Rocky Linux 8. python3-libvirt is The libvirt virtualization API python3 binding

Introduction

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

What is python3-libvirt

The python3-libvirt package contains a module that permits applications written in the Python 3.x programming language to use the interface supplied by the libvirt library to use the virtualization capabilities of recent versions of Linux (and other OSes).

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

Install python3-libvirt 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-libvirt using dnf by running the following command:

sudo dnf -y install python3-libvirt

Install python3-libvirt 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-libvirt using yum by running the following command:

sudo yum -y install python3-libvirt

How To Uninstall python3-libvirt on Rocky Linux 8

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

sudo dnf remove python3-libvirt

python3-libvirt Package Contents on Rocky Linux 8

/usr/lib/.build-id
/usr/lib/.build-id/3b
/usr/lib/.build-id/3b/28469b7318a2ed976e531820eb993eabae5acc
/usr/lib/.build-id/78
/usr/lib/.build-id/78/352fa256ccfb90a25f22969bb035d8a0269203
/usr/lib/.build-id/a1
/usr/lib/.build-id/a1/9df967a16ecdd0272abd1fa98bcf62a7b03d45
/usr/lib64/python3.6/site-packages/__pycache__/libvirt.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/__pycache__/libvirt.cpython-36.pyc
/usr/lib64/python3.6/site-packages/__pycache__/libvirt_lxc.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/__pycache__/libvirt_lxc.cpython-36.pyc
/usr/lib64/python3.6/site-packages/__pycache__/libvirt_qemu.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/__pycache__/libvirt_qemu.cpython-36.pyc
/usr/lib64/python3.6/site-packages/__pycache__/libvirtaio.cpython-36.opt-1.pyc
/usr/lib64/python3.6/site-packages/__pycache__/libvirtaio.cpython-36.pyc
/usr/lib64/python3.6/site-packages/libvirt.py
/usr/lib64/python3.6/site-packages/libvirt_lxc.py
/usr/lib64/python3.6/site-packages/libvirt_python-6.0.0-py3.6.egg-info
/usr/lib64/python3.6/site-packages/libvirt_qemu.py
/usr/lib64/python3.6/site-packages/libvirtaio.py
/usr/lib64/python3.6/site-packages/libvirtmod.cpython-36m-x86_64-linux-gnu.so
/usr/lib64/python3.6/site-packages/libvirtmod_lxc.cpython-36m-x86_64-linux-gnu.so
/usr/lib64/python3.6/site-packages/libvirtmod_qemu.cpython-36m-x86_64-linux-gnu.so
/usr/share/doc/python3-libvirt
/usr/share/doc/python3-libvirt/AUTHORS
/usr/share/doc/python3-libvirt/COPYING
/usr/share/doc/python3-libvirt/COPYING.LESSER
/usr/share/doc/python3-libvirt/ChangeLog
/usr/share/doc/python3-libvirt/NEWS
/usr/share/doc/python3-libvirt/README
/usr/share/doc/python3-libvirt/examples
/usr/share/doc/python3-libvirt/examples/consolecallback.py
/usr/share/doc/python3-libvirt/examples/dominfo.py
/usr/share/doc/python3-libvirt/examples/domipaddrs.py
/usr/share/doc/python3-libvirt/examples/domrestore.py
/usr/share/doc/python3-libvirt/examples/domsave.py
/usr/share/doc/python3-libvirt/examples/domstart.py
/usr/share/doc/python3-libvirt/examples/esxlist.py
/usr/share/doc/python3-libvirt/examples/event-test.py
/usr/share/doc/python3-libvirt/examples/guest-vcpus
/usr/share/doc/python3-libvirt/examples/guest-vcpus/guest-vcpu-daemon.py
/usr/share/doc/python3-libvirt/examples/guest-vcpus/guest-vcpu.py
/usr/share/doc/python3-libvirt/examples/nodestats.py
/usr/share/doc/python3-libvirt/examples/topology.py

References

Summary

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