How To Install apcupsd on Debian 9

In this tutorial we learn how to install apcupsd on Debian 9. apcupsd is APC UPS Power Management (daemon)

Introduction

In this tutorial we learn how to install apcupsd on Debian 9.

What is apcupsd

apcupsd is:

apcupsd provides UPS power management for APC products, including most BackUPS series models (including USB), SmartUPS V/S, SmartUPS (NET/RM), and Matrix series.

It controls and monitors the status of UPS and allows your computer to run for a specified length of time on UPS power, and then executes a controlled shutdown in the case of an extended power failure.

There are three methods to install apcupsd on Debian 9. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install apcupsd Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install apcupsd using apt-get by running the following command:

sudo apt-get -y install apcupsd

Install apcupsd Using apt

Update apt database with apt using the following command.

sudo apt update

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

sudo apt -y install apcupsd

Install apcupsd Using aptitude

If you want to follow this method, you might need to install aptitude first since aptitude is usually not installed by default on Debian. Update apt database with aptitude using the following command.

sudo aptitude update

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

sudo aptitude -y install apcupsd

How To Uninstall apcupsd on Debian 9

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

sudo apt-get remove apcupsd

Uninstall apcupsd And Its Dependencies

To uninstall apcupsd and its dependencies that are no longer needed by Debian 9, we can use the command below:

sudo apt-get -y autoremove apcupsd

Remove apcupsd Configurations and Data

To remove apcupsd configuration and data from Debian 9 we can use the following command:

sudo apt-get -y purge apcupsd

Remove apcupsd configuration, data, and all of its dependencies

We can use the following command to remove apcupsd configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge apcupsd

Dependencies

apcupsd have the following dependencies:

References

Summary

In this tutorial we learn how to install apcupsd package on Debian 9 using different package management tools: apt, apt-get and aptitude.