Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ldd is broken in default install (missing dependency on bash) #34319

Closed
twpayne opened this issue Nov 29, 2021 · 5 comments
Closed

ldd is broken in default install (missing dependency on bash) #34319

twpayne opened this issue Nov 29, 2021 · 5 comments

Comments

@twpayne
Copy link

twpayne commented Nov 29, 2021

System

  • xuname:
    Void 5.4.0-86-generic x86_64 GenuineIntel uptodate rF
  • package:
    affected package(s) including the version: Sorry, I could not find out which package provides /usr/sbin/ldd.

Expected behavior

ldd --version prints a version number and copyright notice.

Actual behavior

ldd --version fails with the error:

/bin/sh: 1: ldd: not found

Steps to reproduce the behavior

With Docker:

$ docker run -it voidlinux/voidlinux:latest /bin/sh
# ldd
/bin/sh: 1: ldd: not found

Explanation

/usr/sbin/ldd is a bash script:

$ head -n 1 /usr/sbin/ldd
#!/bin/bash

By default, bash is not installed, so /usr/sbin/ldd fails with the "not found" error shown above.

Possible fixes

  1. Install /bin/bash as part of the base system.
  2. Modify /usr/sbin/ldd to use /bin/sh instead of /bin/bash, as /bin/sh is part of the base system.

Please let me know if you need any further information.

@ericonr
Copy link
Member

ericonr commented Nov 29, 2021

ldd is provided by glibc, which can be verified with xbps-query -o /usr/bin/ldd. It's, unfortunately, a shell script that uses bashisms (because glibc upstream is very stubborn), but, due to circular dependencies, we can't make glibc depend on bash (and well, for most usages of glibc, you won't use ldd anyway).

I'm not sure this is fixable at all.

@ericonr
Copy link
Member

ericonr commented Nov 29, 2021

Also, the dockerhub images are no longer updated, I recommend moving to https://github.com/void-linux/void-docker/pkgs/container/void-linux

@ericonr
Copy link
Member

ericonr commented Nov 29, 2021

affected package(s) including the version: Sorry, I could not find out which package provides /usr/sbin/ldd.

I see your mistake now: /usr/bin is the canonical directory, everything else is a symlink to it. So packages own file under that hierarchy, not /usr/sbin.

@twpayne
Copy link
Author

twpayne commented Nov 30, 2021

Thank you for the explanations. Feel free to close this issue if it's not fixable.

@ericonr ericonr closed this as completed Dec 2, 2021
@illiliti
Copy link

Bash-free ldd -> https://github.com/gkisslinux/sh-alternatives

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants