How to install apcupsd on Centos 8?

Issues related to applications and software problems and general support
User avatar
TrevorH
Forum Moderator
Posts: 29985
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to install apcupsd on Centos 8?

Post by TrevorH » 2019/11/19 16:54:12

yum --disablerepo=\* --enablerepo=extras downgrade epel-release will downgrade to the copy that we ship in extras and reinstate those files and then a yum update will update it to the latest.
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

leo8888
Posts: 27
Joined: 2015/01/28 20:51:14

Re: How to install apcupsd on Centos 8?

Post by leo8888 » 2019/11/19 17:28:16

TrevorH wrote:
2019/11/19 16:54:12
yum --disablerepo=\* --enablerepo=extras downgrade epel-release will downgrade to the copy that we ship in extras and reinstate those files and then a yum update will update it to the latest.
Wow! Thank you Trevor! That was a scary looking command with the "--disablerepo=\*" part and I wouldn't have even run it if I didn't have a full backup of my system already but it worked and I am able to see all the NUT packages available now!

vcba79
Posts: 30
Joined: 2015/12/21 09:36:06

Re: How to install apcupsd on Centos 8?

Post by vcba79 » 2020/02/25 02:38:51

I can confirm that TrevorH's patch can produce package which both daemon and ui packages will function well.
I have backups 1100 which use usb connection and built packages works like it does in CentOS 7.

ps: you might need GConf2 or GConf2-devel install for this to work which I did.


Hope this helps,


TrevorH wrote:
2019/10/28 20:42:30
If you do want to use apcupsd then I tested and the existing SRPM from EPEL 7 will rebuild quite happily using mock on CentOS 8 if you patch the .spec file with:

Code: Select all

--- apcupsd.spec.orig	2017-05-04 21:20:35.000000000 +0100
+++ apcupsd.spec	2019-10-28 19:52:12.291282368 +0000
@@ -18,8 +18,10 @@
 Patch1:       apcupsd-3.14.4-shutdown.patch
 
 BuildRequires: glibc-devel, gd-devel
-BuildRequires: net-snmp-devel, tcp_wrappers-devel, libusb-devel
-BuildRequires: gtk2-devel, gnome-vfs2-devel, desktop-file-utils
+BuildRequires: net-snmp-devel, libusb-devel
+BuildRequires: gtk2-devel, desktop-file-utils
+BuildRequires: glib2-devel, GConf2-devel, gtk2-devel
+#BuildRequires: gtk2-devel, gnome-vfs2-devel, desktop-file-utils
 # This is part of util-linux in Fedora, but on EL7 it's in sysvinit-tools.
 BuildRequires: /usr/bin/wall
 Requires:      /bin/mail /usr/bin/wall
@@ -85,7 +87,7 @@
         --enable-modbus-usb \
         --enable-gapcmon \
         --enable-pcnet \
-        --with-libwrap=%{_libdir} \
+        --without-libwrap \
         --with-serial-dev= \
         --with-upstype=usb \
         --with-upscable=usb \
The resulting packages are untested since I don't have a CentOS 8 system with an APC UPS hooked up to it. I had to remove gnome-vfs2-devel and tcp_wrappers from the spec to allow it to build and I have no idea what those were used for before.

If you haven't used mock before then you need to install it from the epel-playground or epel-testing repos and update to the latest mock-core-configs package from those repos too. Once it's installed you have to add your user to the 'mock' group with usermod -a -G mock $me then logout and back in to pick up that change (or use newgrp). Once you've done that, set up your user's rpm tree using rpmdev-setuptree (from rpmdevtools) and rpm --install the apcupsd SRPM as your own user. That will place apcupsd.spec in ~/rpmbuild/SPECS and you can apply that patch and then rebuild the SRPM with rpmbuild -bs apcupsd.spec and then feed that into mock --rebuild ~/rpmbuild/SRPMS/apcupsd-3.14.14-5.el8.src.rpm

At the end it should say something like : INFO: Done(/home/trevor/rpmbuild/SRPMS/apcupsd-3.14.14-5.el8.src.rpm) Config(default) 1 minutes 50 seconds

anderson_thomas
Posts: 96
Joined: 2011/11/21 10:19:41

Re: How to install apcupsd on Centos 8?

Post by anderson_thomas » 2020/02/26 08:23:14

Hi,

I've BUILD a rpm package for apcupsd on Fedora COPR for CentOS-8.

https://copr.fedorainfracloud.org/coprs ... r/apcupsd/

Greetings
Klaus.

gmcallister
Posts: 1
Joined: 2020/07/03 23:09:24

Re: How to install apcupsd on Centos 8?

Post by gmcallister » 2020/07/03 23:14:25

nouvo09 wrote:
2019/10/28 16:45:26
If it was me, I'll search into fedora 25 repos which works with a 4.13 kernel, then if available, download the package and then try the installation
with a
rpm -ivh apcupsd.x86_64.......rpm --test

and if not error is reported then install it for good (i-e without --test)

[edit]
you can find package apcupsd-3.14.14-2.fc25.x86_64.rpm

at https://dl.fedoraproject.org/pub/archiv ... ackages/a/
[/edit]
Just adding that this worked for me on CentOS 8
My kernal was: 4.18.0-193.6.3.el8_2.x86_64, matched this with Fedora 29.
The test showed I needed 2 dependencies (libusb, mailx). I installed these, then the rpm successfully. Running the APCUPSD on my Back-UPS XS 700U via USB. To be clear, this is a home lab - and I'm not sure what will happen when the kernal is upgraded... but till then, UPS logging bliss.

User avatar
TrevorH
Forum Moderator
Posts: 29985
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to install apcupsd on Centos 8?

Post by TrevorH » 2020/07/03 23:34:14

apcupsd is in EPEL for CentOS 8.
CentOS 6 died in November 2020 - migrate to a new version!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

Post Reply

Return to “CentOS 8 - General Support”