libsystemd-core-251.so can't find libsystemd-shared-251.so

Asked by Rapha

Hello,
package libsystemd-shared includes two libraries
```
/usr/lib/x86_64-linux-gnu/systemd/libsystemd-core-251.so
/usr/lib/x86_64-linux-gnu/systemd/libsystemd-shared-251.so
```
Running ldd on the first on yields
```
ldd /usr/lib/x86_64-linux-gnu/systemd/libsystemd-core-251.so
        linux-vdso.so.1 (0x00007ffc214b4000)
        libsystemd-shared-251.so => not found
        ...
```
Is that a bug?
In any case, this causes an error when trying to build a rescue image with rear
```sudo rear mkrescue
     ...
     There are binaries or libraries in the ReaR recovery system that need additional libraries
     /usr/lib/x86_64-linux-gnu/systemd/libsystemd-core-251.so requires additional libraries
        libsystemd-shared-251.so => not found
```
Any hints appreciated.
Best, Rapha

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
Manfred Hampl
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

For diagnostic purposes please provide the output of the following commands:

uname -a
lsb_release -crid
ls -l /usr/lib/x86_64-linux-gnu/systemd/libsystemd-core-251.so
ls -l /usr/lib/x86_64-linux-gnu/systemd/libsystemd-shared-251.so
file /usr/lib/x86_64-linux-gnu/systemd/libsystemd-core-251.so
file /usr/lib/x86_64-linux-gnu/systemd/libsystemd-shared-251.so

Revision history for this message
Rapha (raphha2) said :
#2

Hello Manfred,
thanks for looking into this.
All files are in place, and I checked the situation on two machines, that had recently been upgraded from kubuntu 22.04 to 22.10.
So here are the outputs:

> uname -a
Linux hostxyz 5.19.0-23-generic #24-Ubuntu SMP PREEMPT_DYNAMIC Fri Oct 14 15:39:57 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

> lsb_release -crid
Distributor ID: Ubuntu
Description: Ubuntu 22.10
Release: 22.10
Codename: kinetic

> ls -l /usr/lib/x86_64-linux-gnu/systemd/libsystemd-core-251.so
-rw-r--r-- 1 root root 1960464 Okt 11 17:51 /usr/lib/x86_64-linux-gnu/systemd/libsystemd-core-251.so

> ls -l /usr/lib/x86_64-linux-gnu/systemd/libsystemd-shared-251.so
-rw-r--r-- 1 root root 3106488 Okt 11 17:51 /usr/lib/x86_64-linux-gnu/systemd/libsystemd-shared-251.so

> file /usr/lib/x86_64-linux-gnu/systemd/libsystemd-core-251.so
/usr/lib/x86_64-linux-gnu/systemd/libsystemd-core-251.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=bcce0a53b5668559803317ad5da834da97c9d085, stripped

> file /usr/lib/x86_64-linux-gnu/systemd/libsystemd-shared-251.so
/usr/lib/x86_64-linux-gnu/systemd/libsystemd-shared-251.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=483c1dc850e518da5070d87c7018251c18c31165, stripped

And some bonus, maybe helpful:
> dpkg -l libsystemd-shared
ii libsystemd-shared:amd64 251.4-1ubuntu7 amd64 systemd shared private library

> dpkg -L libsystemd-shared
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/systemd
/usr/lib/x86_64-linux-gnu/systemd/libsystemd-core-251.so
/usr/lib/x86_64-linux-gnu/systemd/libsystemd-shared-251.so
/usr/share
/usr/share/doc
/usr/share/doc/libsystemd-shared
/usr/share/doc/libsystemd-shared/changelog.Debian.gz
/usr/share/doc/libsystemd-shared/copyright
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/libsystemd-shared

> apt show libsystemd-shared
Package: libsystemd-shared
Version: 251.4-1ubuntu7
Priority: important
Section: libs
Source: systemd
Origin: Ubuntu
Maintainer: Ubuntu Developers <email address hidden>
Original-Maintainer: Debian systemd Maintainers <email address hidden>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 5.262 kB
Depends: libacl1 (>= 2.2.23), libapparmor1 (>= 2.13), libaudit1 (>= 1:2.2.1), libblkid1 (>= 2.24), libc6 (>= 2.36), libcap2 (>= 1:2.10), libcrypt1 (>= 1:4.4.0), libgcrypt20 (>= 1.10.0), libip4tc2 (>= 1.8.3), libkmod2 (>= 15), liblz4-1 (>= 0.0~r130), liblzma5 (>= 5.1.1alpha+20120614), libmount1 (>= 2.30), libpam0g (>= 0.99.7.1), libseccomp2 (>= 2.4.1), libselinux1 (>= 3.1~), libssl3 (>= 3.0.0), libzstd1 (>= 1.5.2)
Homepage: https://www.freedesktop.org/wiki/Software/systemd
Task: minimal, server-minimal
Download-Size: 1.703 kB
APT-Manual-Installed: no
APT-Sources: http://de.archive.ubuntu.com/ubuntu kinetic/main amd64 Packages
Description: systemd shared private library
 This internal shared library provides common code used by various systemd
 components. It is supposed to decrease memory and disk footprint.
 The shared library is not meant for public use and is not API or ABI stable.

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

Strange, my kinetic test system behaves similar.

If I run

LD_PRELOAD=/usr/lib/x86_64-linux-gnu/systemd/libsystemd-shared-251.so ldd /usr/lib/x86_64-linux-gnu/systemd/libsystemd-core-251.so

then the library is correctly found and loaded.
You could try the same with rear.

This definitely is just a workaround and not a solution.

I am inclined to say that this is a bug.

Revision history for this message
Rapha (raphha2) said :
#4

Thanks Manfred, I opend a bug report.

Also rear finishes without errors now, using your workaround:
sudo bash -c "LD_PRELOAD=/usr/lib/x86_64-linux-gnu/systemd/libsystemd-shared-251.so rear mkrescue"

Revision history for this message
Best Manfred Hampl (m-hampl) said :
#5

Other workaround might be
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/systemd/ whatever_command
or
adding /usr/lib/x86_64-linux-gnu/systemd/ into /etc/ld.so.conf.d/whatever_filename.conf

Revision history for this message
Rapha (raphha2) said :
#6

OK, so that means that the newly introduced subdir "systemd" (in kinetic) simply wasn't added to the lib search path?
Anyhow, that solved my original problem without the hassle of always including the LD_PRELOAD...
Thanks again.

Revision history for this message
Rapha (raphha2) said :
#7

Thanks Manfred Hampl, that solved my question.

Revision history for this message
Rapha (raphha2) said :
#8

Oh, so ppl won't say thank you anymore to the extend that launchpad now creates an automatic gratitude message or what? Haven't seen that before...