Need to update apcupsd, how?

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
gene0915
Level 3
Level 3
Posts: 127
Joined: Sun Oct 26, 2014 7:52 pm

Need to update apcupsd, how?

Post by gene0915 » Sat Dec 02, 2017 11:38 pm

Using an APC UPS and I'm having this exact same problem: https://bugs.launchpad.net/ubuntu/+sour ... ug/1549576

In there, they talk about how I need to upgrade to version 3.14.14 (Mint has 3.14.12). Looks like I need to compile from source. Guessing I need to make sure the Linux kernel headers are installed first? Or, since I guess this version is in Yakkety, is there some way I can add that repo as a source and install it from there?

gene0915
Level 3
Level 3
Posts: 127
Joined: Sun Oct 26, 2014 7:52 pm

Re: Need to update apcupsd, how?

Post by gene0915 » Sun Dec 03, 2017 12:05 am

BTW, forgot to mention that I saw this post at the top: viewtopic.php?f=90&t=230142 (about compiling) but with my luck, I'm worried I screw something up and just want to take the easy way out....adding that Ubuntu repository. :) If not, tomorrow some time, I'll give compiling the 3.14.14 version a shot.

User avatar
phd21
Level 16
Level 16
Posts: 6982
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Need to update apcupsd, how?

Post by phd21 » Sun Dec 03, 2017 12:34 am

Hi "gene0915",

It is pretty easy to compile and install this newer version of APC UPS application "apcupsd" from their archive source code file "apcupsd-3.14.14.tar.gz". I just did this in my Linux Mint 18.2 system and it worked well.

Update: I just created an "apcupsd_3.14.14-2_amd64.deb" installation file for 64-bit computers using "checkinstall" from my just compiled and installed version of this. If you want to try this deb file, click link below, save the file, and double click to install it, OR compile it yourself using the instructions below.
https://my.pcloud.com/publink/show?code ... jPe8b8mTLX

To compile APC UPS software (apcupsd) from source code:
Just download their file "apcupsd-3.14.14.tar.gz", right click it, select extract here, browse into the new "apcupsd-3.14.14" folder, right click anywhere in the whitespace and select "actions", then "open terminal here".

Install the basic compiling programs using the console terminal command below.
Open a console terminal, type in, or copy & paste, each line below one by one:
Click "Select All" above command, right click the highlighted command, select Copy (or Ctrl+Insert), click in the console terminal window, and right click paste (or Shift+Insert), repeat for each command.

Code: Select all

sudo apt install build-essential cmake extra-cmake-modules
To compile and install "apcupsd":
Open a console terminal, type in, or copy & paste, each line below one by one:
Click "Select All" above command, right click the highlighted command, select Copy (or Ctrl+Insert), click in the console terminal window, and right click paste (or Shift+Insert), repeat for each command.

Code: Select all

./configure

Code: Select all

make

Code: Select all

sudo make install
This is a good post on installing, configuring, and using the APC UPS software
UPS GUI software ? (SOLVED)
viewtopic.php?t=252490


FYI: To run "apctest" (sudo apctest), the "apcupsd" service daemon must not be running.
To stop "apcupsd"

Code: Select all

sudo service apcupsd stop
To restart "apcupsd"

Code: Select all

sudo service apcupsd restart


Hope this helps ...
Last edited by phd21 on Sun Dec 03, 2017 1:15 pm, edited 3 times in total.
Phd21: Mint KDE 17.3 & 18.3, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram,256gb SDD, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

gene0915
Level 3
Level 3
Posts: 127
Joined: Sun Oct 26, 2014 7:52 pm

Re: Need to update apcupsd, how?

Post by gene0915 » Sun Dec 03, 2017 2:12 am

phd21 wrote: Hope this helps ...
Thank you so much!! I grabbed your .deb file and it installed but when I ran it, it bombed out and I got this error: "Most likely, you need to add --enable-usb to your ./configure opti" ..... so I went with your original instructions on how to compile it myself and added that parameter to the ./configure line and presto chango, ir'a working perfectly now!

Again, thank you so much!

User avatar
phd21
Level 16
Level 16
Posts: 6982
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Need to update apcupsd, how?

Post by phd21 » Sun Dec 03, 2017 2:57 am

Hi "gene0915",

You are most welcome.

FYI: That is the first time I ever created a Linux installation deb file from a software's compiled source code. It worked perfectly on my ancient computer system with an even more ancient APC UPS connected using the serial port not USB. I guess that is why I did not get that USB message. I'll try recompiling it again with that USB parameter.
Last edited by phd21 on Sun Dec 03, 2017 3:32 am, edited 1 time in total.
Phd21: Mint KDE 17.3 & 18.3, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram,256gb SDD, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

User avatar
phd21
Level 16
Level 16
Posts: 6982
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Need to update apcupsd, how?

Post by phd21 » Sun Dec 03, 2017 3:30 am

Hi "gene0915",

I recompiled the "apcupsd" source code using the USB parameter "--enable-usb" and some other ones, then I recreated the Linux Deb file. Could you please download this and see if it will install on your system without any error messages? It is perfectly alright to reinstall it. Thank you.

Newly created Linux installation deb file for 64-bit computers for "apcupsd". I updated the previous link to this file as well.

apcupsd_3.14.14-2_amd64.deb
https://my.pcloud.com/publink/show?code ... jPe8b8mTLX


...
Phd21: Mint KDE 17.3 & 18.3, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram,256gb SDD, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

gene0915
Level 3
Level 3
Posts: 127
Joined: Sun Oct 26, 2014 7:52 pm

Re: Need to update apcupsd, how?

Post by gene0915 » Wed Dec 06, 2017 4:04 pm

phd21 wrote:Hi "gene0915",

I recompiled the "apcupsd" source code using the USB parameter "--enable-usb" and some other ones, then I recreated the Linux Deb file. Could you please download this and see if it will install on your system without any error messages? It is perfectly alright to reinstall it. Thank you.

Newly created Linux installation deb file for 64-bit computers for "apcupsd". I updated the previous link to this file as well.

apcupsd_3.14.14-2_amd64.deb
https://my.pcloud.com/publink/show?code ... jPe8b8mTLX


...
Crap, sorry for not writing sooner but that did the trick! Thank you!!

User avatar
phd21
Level 16
Level 16
Posts: 6982
Joined: Thu Jan 09, 2014 9:42 pm
Location: Florida

Re: Need to update apcupsd, how?

Post by phd21 » Wed Dec 06, 2017 4:40 pm

Hi "gene0915",

You are welcome...

Glad to see that works too.
Phd21: Mint KDE 17.3 & 18.3, 64-bit Awesome OS, Ancient Dell OptiPlex 780 Core2Duo E8400 3GHz,4gb Ram,256gb SDD, Video: Intel 4 Graphics, DVD Lightscribe. Why I use KDE?:https://opensource.com/life/15/4/9-reasons-to-use-kde

User avatar
braselectron
Level 1
Level 1
Posts: 1
Joined: Wed May 09, 2018 5:46 pm

Re: Need to update apcupsd, how?

Post by braselectron » Wed May 09, 2018 6:17 pm

Hi, I was looking for a similar way to update my apcupsd installation.

I have noticed random shutdowns (after I replaced the batteries) and status not able to know if self test was OK (ie. it clears the test status after a few minutes), and other "bugs".

I have a APC RS1500 and I was able to "hack" my USB cable to connect it to my Intel desktop USB port.
https://allpinouts.org/pinouts/cables/m ... schematic/

I am using the standard repository version VERSION : 3.14.10 (13 September 2011) debian
I am on this desktop running Ubuntu 14.04 (32bit) version, since this is a old desktop.

These are my questions:

1) do I need to remove the old version first (ie. apt remove apcupsd) before "make install" or should I just run it over the previous install ?
2) since I will remove without a "purge" will it keep the config files or should I backup them first ?
3) since we need to make from source the new version, other than the "--enable-usb" option, what are the other options we need to add before make ?
4) before a make install, can I test it right after make has generated the binary of apcupsd/apcaccess/etc. ? How ? since I get error message if I try to run the new code.
4.1) I usually test the binary before I do a make install.

Best regards,

John


Update:
After the "make", I stopped the apcupsd service, and moved the new binaries (ie. apcaccess, apctest and apcupsd) to /sbin/ after I backup of the old ones to <name>.old . Started the service again and checked the new version number using the sudo apcaccess status. After a few minutes the "Emergency!" message again showed up.

I really need help on this. I suspect of a configuration error.

Post Reply

Return to “Newbie Questions”