TransWikia.com

Ubuntu 18.04 upgraded from 16.04 cannot load upowerd, cannot find libssl.so.1.0.2

Unix & Linux Asked by Neek on November 26, 2021

I ran 16.04 since it was released as a fresh install, and about a month ago upgraded to 18.04 using the official upgrade mechanism. I’ve noticed this in syslog:

Sep 27 17:40:36 yavin systemd[1]: Starting Daemon for power management...
Sep 27 17:40:36 yavin upowerd[836]: /usr/lib/upower/upowerd: error while loading shared libraries: libssl.so.1.0.2: cannot open shared object fil
e: No such file or directory
Sep 27 17:40:36 yavin systemd[1]: upower.service: Main process exited, code=exited, status=127/n/a
Sep 27 17:40:36 yavin systemd[1]: upower.service: Failed with result 'exit-code'.
Sep 27 17:40:36 yavin systemd[1]: Failed to start Daemon for power management.
Sep 27 17:40:36 yavin systemd[1]: upower.service: Service hold-off time over, scheduling restart.
Sep 27 17:40:36 yavin systemd[1]: upower.service: Scheduled restart job, restart counter is at 1.
Sep 27 17:40:36 yavin systemd[1]: Stopped Daemon for power management.
Sep 27 17:40:36 yavin systemd[1]: Starting Daemon for power management...
Sep 27 17:40:36 yavin upowerd[846]: /usr/lib/upower/upowerd: error while loading shared libraries: libssl.so.1.0.2: cannot open shared object file: No such file or directory
Sep 27 17:40:36 yavin systemd[1]: upower.service: Main process exited, code=exited, status=127/n/a
Sep 27 17:40:36 yavin systemd[1]: upower.service: Failed with result 'exit-code'.
Sep 27 17:40:36 yavin systemd[1]: Failed to start Daemon for power management.
Sep 27 17:40:36 yavin systemd[1]: upower.service: Service hold-off time over, scheduling restart.
Sep 27 17:40:36 yavin systemd[1]: upower.service: Scheduled restart job, restart counter is at 2.

So upowerd cannot find libssl.so.1.0.2, sure enough:

$ ldd -v /usr/lib/upower/upowerd | grep 'not found'
    libssl.so.1.0.2 => not found
    libcrypto.so.1.0.2 => not found
        libcrypto.so.1.0.2 (OPENSSL_1.0.2d) => not found
        libssl.so.1.0.2 (OPENSSL_1.0.2d) => not found

Is upowerd still used in 18.04, and if so, how can I confirm which versions of it and libssl/libcrypto I have, which I need, and perhaps forcably re-install them?

Here’s what I seem to have installed:

$ sudo apt list --installed | grep "libssl"

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libssl-dev/now 1.1.0h-2.0+ubuntu16.04.1+deb.sury.org+1 amd64 [installed,local]
libssl-doc/now 1.1.0h-2.0+ubuntu16.04.1+deb.sury.org+1 all [installed,local]
libssl1.0.0/bionic-updates,bionic-security,now 1.0.2n-1ubuntu5.1 amd64 [installed]
libssl1.1/now 1.1.0h-2.0+ubuntu16.04.1+deb.sury.org+1 amd64 [installed,local]

And libcrypto:

$ sudo apt list --installed | grep "crypto"

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libblockdev-crypto2/bionic,now 2.16-2 amd64 [installed]
libhcrypto4-heimdal/bionic,now 7.5.0+dfsg-1 amd64 [installed]
libk5crypto3/bionic,now 1.16-2build1 amd64 [installed,automatic]
python-crypto/bionic,now 2.6.1-8ubuntu2 amd64 [installed,automatic]
python3-asn1crypto/bionic,bionic,now 0.24.0-1 all [installed]
python3-crypto/bionic,now 2.6.1-8ubuntu2 amd64 [installed]
python3-cryptography/bionic-updates,bionic-security,now 2.1.4-1ubuntu1.2 amd64 [installed]

This may have been a problem since before the upgrade. Without upowerd I have no battery level management and my laptop has powered down suddenly losing work a couple of times and I recall this happening before the upgrade also.

EDIT

As requested, output of apt policy upower:

upower:
  Installed: 0.99.7-2
  Candidate: 0.99.7-2
  Version table:
 *** 0.99.7-2 500
        500 http://ubuntu.ipserverone.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status

EDIT 2

Asking apt to reinstall upower results in the same package being installed, and no change in apt policy upower output.

$ sudo apt install --reinstall upower
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 45 not upgraded.
Need to get 102 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://ubuntu.ipserverone.com/ubuntu bionic/main amd64 upower amd64 0.99.7-2 [102 kB]
Fetched 102 kB in 0s (381 kB/s)  
(Reading database ... 283627 files and directories currently installed.)
Preparing to unpack .../upower_0.99.7-2_amd64.deb ...
Unpacking upower (0.99.7-2) over (0.99.7-2) ...
Setting up upower (0.99.7-2) ...
upower.service is a disabled or a static unit not running, not starting it.
Processing triggers for man-db (2.8.3-2) ...
Processing triggers for dbus (1.12.2-1ubuntu1) ...

$ sudo apt policy upower
upower:
  Installed: 0.99.7-2
  Candidate: 0.99.7-2
  Version table:
 *** 0.99.7-2 500
        500 http://ubuntu.ipserverone.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status

No diversions seem to be set up, and the libssl and libcrypto libraries are still not found by the upowerd binary:

$ dpkg-divert --list /usr/lib/upower/upowerd

$ ldd -v /usr/lib/upower/upowerd | grep 'not found'
    libssl.so.1.0.2 => not found
    libcrypto.so.1.0.2 => not found
        libcrypto.so.1.0.2 (OPENSSL_1.0.2d) => not found
        libssl.so.1.0.2 (OPENSSL_1.0.2d) => not found

EDIT adding comparison with fresh install of Ubuntu 18.04

Since @stephen-kitt mentioned upowerd isn’t supposed to depend on libssl, I installed a fresh virtual machine with 18.04 and sure enough, the ldd list is different.

laptop with problem except from ldd -v /usr/lib/upower/upowerd

ibffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007ff3f0466000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007ff3f01f5000)
libssl.so.1.0.2 => not found
libcrypto.so.1.0.2 => not found
libusbmuxd.so.4 => /usr/lib/x86_64-linux-gnu/libusbmuxd.so.4 (0x00007ff3effed000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff3f2f14000)

fresh 18.04 install

libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f4aa91de000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f4aa8f6c000)
libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007f4aa8c07000)
libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f4aa89f4000)
libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f4aa86d9000)
libusbmuxd.so.4 => /usr/lib/x86_64-linux-gnu/libusbmuxd.so.4 (0x00007f4aa84d1000)
/lib64/ld-linux-x86-64.so.2 (0x00007f4aabc8c000)

For some reason the laptop links against libssl and libcrypto, while fresh install links to libgnutls, libtasn1 and libgcrypt.

The fresh install still reports the same apt policy as the laptop:

$ apt policy upower
upower:
  Installed: 0.99.7-2
  Candidate: 0.99.7-2
  Version table:
 *** 0.99.7-2 500
        500 http://th.archive.ubuntu.com/ubuntu bionic/main amd64 Packages
        100 /var/lib/dpkg/status

I’ve no idea why this might be.

Pretty soon I’m just going to reinstall the laptop (it has other issues like very long delays in apps like gedit loading) but it would be nice to figure out how this mess happened.

4 Answers

I had a similar issue and finally found how to solve it :

The main thing to understand is that it's not upowerd itself that links against a non-existant library but one of the libraries it links against then links to a nonexistant library.

In order to view the dependency chain, do:

ldd -v /usr/lib/upower/upowerd

This will give you a hierarchical view of the library dependencies. Track down the missing library and check what library depends on it. In my case it was a library that I had installed manually. Removing it solved the problem.

Answered by Antoine Reversat on November 26, 2021

Just fixed the same issue upgrading from 19.10 to 20.04.

Running dpkg install --reinstall and dpkg --verify didn't help, but they did confirm that I had the correct package installed.

Running ldd /usr/lib/upower/upowerd showed a bad dependency, in my case, on libusbmuxd-04.

Running objdump -p /usr/lib/upower/upowerd | grep usbmux did not show the dependency.

The problem seemed to be in /etc/ld.so.cache so removing that file helped, but only until the next time the cache was built.

Eventually it turned out to be a library in /usr/local that was causing the problem, and I found that by:

sudo rm /etc/ld.so/cache
export LD_DEBUG=files
ldd /usr/lib/upower/upowerd

And that give a better trace that ultimately pointed me at the /usr/local/lib file that was causing the trouble.

Answered by Steven Dickinson on November 26, 2021

I seem to have fixed this by finding this post https://stackoverflow.com/questions/46969560/messed-up-my-ubuntu-16-installation-gtk-upowerd-issues where someone with Ubuntu 16 (which I had originally) had the same issues as me. I followed his advice to manually install a libssl .deb package, and now nautilus loads instantly and I can access my 'Power' setting page again.

ldd upowerd also now does not show any 'not found', and can link against the newly installed libssl and libcrypto:

    libssl.so.1.0.2 => /usr/lib/x86_64-linux-gnu/libssl.so.1.0.2 (0x00007f9026ee7000)
    libcrypto.so.1.0.2 => /usr/lib/x86_64-linux-gnu/libcrypto.so.1.0.2 (0x00007f9026a85000)

So I do not know precisely how my system got screwed up but obviously installing that package has provided some .so libraries that have fixed the symptoms.

I'd welcome any further comments, as I still wonder why upowerd is trying to link against libraries that it doesn't with a fresh install (see my posts above about a fresh install in a virtual machine having different ldd -v output to my system, despite them both having identical upowerd packages installed).

Not sure if I should Accept this answer, since I'm not very happy with the situation :) I feel that some would say I haven't 'fixed' it the right way, I've just worked around the problem with a hack.

Answered by Neek on November 26, 2021

Somehow you’ve ended up with a version of /usr/lib/upower/upowerd which doesn’t correspond to the file contained in the upower package.

To fix this, re-install the package:

sudo apt install --reinstall upower

If that doesn’t help, check whether there are any diversions:

dpkg-divert --list /usr/lib/upower/upowerd

If that shows a diversion, check the corresponding package; you might need to upgrade or remove it.

Answered by Stephen Kitt on November 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP