How To Install apcupsd on CentOS 7

In this tutorial we learn how to install apcupsd on CentOS 7. apcupsd is APC UPS Power Control Daemon

Introduction

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

What is apcupsd

Apcupsd can be used for controlling most APC UPSes. During a power failure, apcupsd will inform the users about the power failure and that a shutdown may occur. If power is not restored, a system shutdown will follow when the battery is exausted, a timeout (seconds) expires, or the battery runtime expires based on internal APC calculations determined by power consumption rates. If the power is restored before one of the above shutdown conditions is met, apcupsd will inform users about this fact. Some features depend on what UPS model you have (simple or smart).

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

Install apcupsd on CentOS 7 Using yum

Update yum database with yum using the following command.

sudo yum makecache

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

sudo yum -y install apcupsd

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

sudo dnf -y install apcupsd

How To Uninstall apcupsd on CentOS 7

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

sudo dnf remove apcupsd

References

Summary

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