How To Install apcupsd on Fedora 34

apcupsd is APC UPS Power Control Daemon

Introduction

In this tutorial we learn how to install apcupsd on Fedora 34.

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 Fedora 34. In this tutorial we discuss both methods but you only need to choose one of method to install apcupsd.

Install apcupsd on Fedora 34 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

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

sudo dnf -y install apcupsd

Install apcupsd on Fedora 34 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

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

sudo yum -y install apcupsd

How To Uninstall apcupsd on Fedora 34

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

sudo dnf remove apcupsd

apcupsd Package Contents on Fedora 34

/etc/apcupsd
/etc/apcupsd/apccontrol
/etc/apcupsd/apcupsd.conf
/etc/apcupsd/changeme
/etc/apcupsd/commfailure
/etc/apcupsd/commok
/etc/apcupsd/offbattery
/etc/apcupsd/onbattery
/etc/logrotate.d/apcupsd
/lib/systemd/system-shutdown/apcupsd_shutdown
/lib/systemd/system/apcupsd.service
/sbin/apcaccess
/sbin/apctest
/sbin/apcupsd
/sbin/smtp
/usr/lib/.build-id
/usr/lib/.build-id/19
/usr/lib/.build-id/19/3c9b5e264fd6a4b6eed3cbd306f6ccf144556a
/usr/lib/.build-id/2a
/usr/lib/.build-id/2a/c103cfafab969d6724630e1dfb02fcda4e4e80
/usr/lib/.build-id/b4
/usr/lib/.build-id/b4/486e299a288b18d0dd06e2363cc17d80a6a127
/usr/lib/.build-id/cb
/usr/lib/.build-id/cb/9760aeece91a4d02d35c44918b577f69e40630
/usr/share/doc/apcupsd
/usr/share/doc/apcupsd/ChangeLog
/usr/share/doc/apcupsd/ReleaseNotes
/usr/share/doc/apcupsd/examples
/usr/share/doc/apcupsd/examples/Makefile
/usr/share/doc/apcupsd/examples/SmartUPS1400.snmp
/usr/share/doc/apcupsd/examples/client.c
/usr/share/doc/apcupsd/examples/gui
/usr/share/doc/apcupsd/examples/gui/about.tcl
/usr/share/doc/apcupsd/examples/gui/apcupsd.tcl
/usr/share/doc/apcupsd/examples/gui/dialog.tcl
/usr/share/doc/apcupsd/examples/gui/events.tcl
/usr/share/doc/apcupsd/examples/gui/mainwindow.tcl
/usr/share/doc/apcupsd/examples/gui/pkgIndex.tcl
/usr/share/doc/apcupsd/examples/gui/splash.tcl
/usr/share/doc/apcupsd/examples/gui/status.tcl
/usr/share/doc/apcupsd/examples/hid-set.c
/usr/share/doc/apcupsd/examples/hid-ups.c
/usr/share/doc/apcupsd/examples/hiddev.h
/usr/share/doc/apcupsd/examples/index.php
/usr/share/doc/apcupsd/examples/libusb.h
/usr/share/doc/apcupsd/examples/make-hiddev
/usr/share/doc/apcupsd/examples/megaclient.c
/usr/share/doc/apcupsd/examples/nagios_plugin_check_apcupsd.c
/usr/share/doc/apcupsd/examples/newslave.c
/usr/share/doc/apcupsd/examples/offbattery.cpufreq
/usr/share/doc/apcupsd/examples/onbattery.cpufreq
/usr/share/doc/apcupsd/examples/php-monitor.txt
/usr/share/doc/apcupsd/examples/rpt
/usr/share/doc/apcupsd/examples/rpt/Back-UPS-350-USB.rpt
/usr/share/doc/apcupsd/examples/rpt/Back-UPS-350ES.rpt
/usr/share/doc/apcupsd/examples/rpt/Back-UPS-500-USB.rpt
/usr/share/doc/apcupsd/examples/rpt/Back-UPS-500ES.rpt
/usr/share/doc/apcupsd/examples/rpt/Back-UPS-BR-800.rpt
/usr/share/doc/apcupsd/examples/rpt/Back-UPS-CS-650.rpt
/usr/share/doc/apcupsd/examples/rpt/Back-UPS-ES-550.rpt
/usr/share/doc/apcupsd/examples/rpt/Back-UPS-XS-1300-LCD.rpt
/usr/share/doc/apcupsd/examples/rpt/BackUPS.rpt
/usr/share/doc/apcupsd/examples/rpt/Smart-UPS-1500.rpt
/usr/share/doc/apcupsd/examples/rpt/SmartUPS-USB.rpt
/usr/share/doc/apcupsd/examples/rpt/SmartUPS.rpt
/usr/share/doc/apcupsd/examples/rpt/hid-ups.rpt
/usr/share/doc/apcupsd/examples/safe.apccontrol
/usr/share/doc/apcupsd/examples/smartsim.c
/usr/share/doc/apcupsd/examples/snoopdecode.c
/usr/share/doc/apcupsd/examples/status
/usr/share/doc/apcupsd/examples/status/Back-UPS-BX-1500.status
/usr/share/doc/apcupsd/examples/status/Back-UPS-Pro-1000.status
/usr/share/doc/apcupsd/examples/status/BackUPS-USB.status
/usr/share/doc/apcupsd/examples/status/JapaneseUPS.status
/usr/share/doc/apcupsd/examples/status/PowerStack450.status
/usr/share/doc/apcupsd/examples/status/SmartUPS-vs-650.status
/usr/share/doc/apcupsd/examples/status/SmartUPS1000.status
/usr/share/doc/apcupsd/examples/status/SmartUPS1400.status
/usr/share/doc/apcupsd/examples/status/SmartUPS3000.status
/usr/share/doc/apcupsd/examples/status/SmartUPS5000.status
/usr/share/doc/apcupsd/examples/status/SmartUPS600.status
/usr/share/doc/apcupsd/examples/status/SmartUPS700-2.status
/usr/share/doc/apcupsd/examples/status/SmartUPS700.status
/usr/share/doc/apcupsd/examples/status/newbackupspro1.status
/usr/share/doc/apcupsd/examples/status/newbackupspro2.status
/usr/share/doc/apcupsd/examples/upsapm.c
/usr/share/doc/apcupsd/examples/usb_hid_usages
/usr/share/doc/apcupsd/examples/usbsnoop.txt
/usr/share/hal/fdi/policy/20thirdparty/80-apcupsd-ups-policy.fdi
/usr/share/licenses/apcupsd
/usr/share/licenses/apcupsd/COPYING
/usr/share/man/man5/apcupsd.conf.5.gz
/usr/share/man/man8/apcaccess.8.gz
/usr/share/man/man8/apccontrol.8.gz
/usr/share/man/man8/apctest.8.gz
/usr/share/man/man8/apcupsd.8.gz

References

Summary

In this tutorial we learn how to install apcupsd on Fedora 34 using yum and dnf.