How To Install mcrypt on CentOS 7

In this tutorial we learn how to install mcrypt on CentOS 7. mcrypt is Replacement for crypt()

Introduction

In this tutorial we learn how to install mcrypt on CentOS 7.

What is mcrypt

MCrypt is a replacement for the old crypt() package and crypt(1) command, with extensions. It allows developers to use a wide range of encryption functions, without making drastic changes to their code. It allows users to encrypt files or data streams without having to be cryptographers.

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

Install mcrypt on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install mcrypt using yum by running the following command:

sudo yum -y install mcrypt

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

sudo dnf -y install mcrypt

How To Uninstall mcrypt on CentOS 7

To uninstall only the mcrypt package we can use the following command:

sudo dnf remove mcrypt

References

Summary

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