How To Install perl-Time-Mock on CentOS 7

In this tutorial we learn how to install perl-Time-Mock on CentOS 7. perl-Time-Mock is Replaces actual time with simulated time - alternative to

Introduction

In this tutorial we learn how to install perl-Time-Mock on CentOS 7.

What is perl-Time-Mock

This is an alternative to Test to test code at specific points in time. Test but doesn’t allow you to accelerate the time step and doesn’t deal with Time forks.

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

Install perl-Time-Mock on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

After updating yum database, We can install perl-Time-Mock using yum by running the following command:

sudo yum -y install perl-Time-Mock

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

sudo dnf -y install perl-Time-Mock

How To Uninstall perl-Time-Mock on CentOS 7

To uninstall only the perl-Time-Mock package we can use the following command:

sudo dnf remove perl-Time-Mock

References

Summary

In this tutorial we learn how to install perl-Time-Mock on CentOS 7 using yum and dnf.