How To Install python3-pyfakefs on AlmaLinux 8

In this tutorial we learn how to install python3-pyfakefs in AlmaLinux 8. python3-pyfakefs is pyfakefs implements a fake file system that mocks the Python file system modules.

Introduction

In this tutorial we learn how to install python3-pyfakefs on AlmaLinux 8.

What is python3-pyfakefs

pyfakefs implements a fake file system that mocks the Python file system modules. Using pyfakefs, your tests operate on a fake file system in memory without touching the real disk. The software under test requires no modification to work with pyfakefs.

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

Install python3-pyfakefs on AlmaLinux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install python3-pyfakefs

Install python3-pyfakefs on AlmaLinux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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

sudo yum -y install python3-pyfakefs

How To Uninstall python3-pyfakefs on AlmaLinux 8

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

sudo dnf remove python3-pyfakefs

References

Summary

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