How To Install python2-filelock on CentOS 7

In this tutorial we learn how to install python2-filelock on CentOS 7. python2-filelock is A platform independent file lock

Introduction

In this tutorial we learn how to install python2-filelock on CentOS 7.

What is python2-filelock

This package contains a single module, which implements a platform independent file locking mechanism for Python. The lock includes a lock counter and is thread safe. This means, when locking the same lock object twice, it will not block.

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

Install python2-filelock on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install python2-filelock

Install python2-filelock on CentOS 7 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 python2-filelock using dnf by running the following command:

sudo dnf -y install python2-filelock

How To Uninstall python2-filelock on CentOS 7

To uninstall only the python2-filelock package we can use the following command:

sudo dnf remove python2-filelock

References

Summary

In this tutorial we learn how to install python2-filelock on CentOS 7 using yum and dnf.