Thursday, September 1, 2022

[SOLVED] Linux check dependencies of executable

Issue

I'm currently struggling with getting an executable to run inside a Docker container for work. When I try to run it I just get the following error bash: no such file or directory: ./[executable_name]

I know that just running sudo apt install lsb would fix the issue, as that is fixing the issue on the WSL2 version of Ubuntu. However, the specific Docker image I have to work with (debian bullseye) does not have an installation candidate for lsb. lsb-core also fulfills this dependency, however also isn't available.

I know that I can check for dependencies using the ldd command, however it shows all dependencies as satisfied.

ldd [executable_name]
    linux-vdso.so.1 (0x00007ffce612c000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fdfb401e000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fdfb3ffb000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fdfb3e09000)
    /lib64/ld-lsb-x86-64.so.3 => /lib64/ld-linux-x86-64.so.2 (0x00007fdfb402f000)

(Well, there is no location for linux-vdso.so.1 (0x00007ffce612c000), but as far as I understand that shouldn't be the issue)

I don't even know if the issue lies with missing lsb/lsb-core, or some dependencies they require. Is there any convenient way for me to figure out what dependencies are missing beyond just trial and error installing the dependencies of lsb-core one by one, to see which one actually is needed?

Edit: Yes, I am aware that this looks an issue with me not using the correct path/file permissions, however I can guarantee you, that this is not the case. I've tripple checked the path, verified it with ls, and verified the file permissions with ls -l.


Solution

Oooooooookay, that's not strictly an answer to the initial question, aka on how to figure out which specific library I'm missing, however I fixed my specific issue.

sudo apt install alien
wget https://distrib-coffee.ipsl.jussieu.fr/pub/linux/altlinux/p10/branch/x86_64/RPMS.classic/lsb-core-5.0-alt1.x86_64.rpm
sudo alien --to-deb -c lsb-core-5.0-alt1.x86_64.rpm

And then providing this *.deb file to the Docker container and installing it fixed the issue. So I guess it was just lsb-core missing, and obtaining the .rpm version of it and converting it to the .deb format is compatible enough for my usecase!

I stumbled upon this solution thanks to this wonderful thread.



Answered By - Lucy The Brazen
Answer Checked By - Marie Seifert (WPSolving Admin)