How To Install etckeeper on CentOS 7

In this tutorial we learn how to install etckeeper on CentOS 7. etckeeper is Store /etc in a SCM system (git, mercurial, bzr or darcs)

Introduction

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

What is etckeeper

The etckeeper program is a tool to let /etc be stored in a git, mercurial, bzr or darcs repository. It hooks into yum to automatically commit changes made to /etc during package upgrades. It tracks file metadata that version control systems do not normally support, but that is important for /etc, such as the permissions of /etc/shadow. It’s quite modular and configurable, while also being simple to use if you understand the basics of working with version control. The default backend is git, if want to use a another backend please install the appropriate tool (mercurial, darcs or bzr). To use bazaar/breezy as backend, please also install the etckeeper-bzr package. To start using the package please read /usr/share/doc/etckeeper-1.18.16/README.

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

Install etckeeper on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install etckeeper

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

sudo dnf -y install etckeeper

How To Uninstall etckeeper on CentOS 7

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

sudo dnf remove etckeeper

References

Summary

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