0

I'm trying to get an executable to work, it's currently running fine on one Nixos host, but not the new one.

On old host:

[root@XenonKiloCranberry:~/blog]# ldd app
    linux-vdso.so.1 (0x00007fffd68fb000)
    libm.so.6 => /nix/store/7gx4kiv5m0i7d7qkixq2cwzbr10lvxwc-glibc-2.27/lib/libm.so.6 (0x00007f591bf32000)
    libpq.so.5 => /nix/store/sf3jq8d81gx6fmxsi0mhagpgsgpnxf6m-postgresql-9.6.12-lib/lib/libpq.so.5 (0x00007f591bd03000)

On new host:

[root@XenonKiloCranberry:~/blog]# ldd /root/blog/app
    linux-vdso.so.1 (0x00007fff6cb89000)
    libm.so.6 => /nix/store/681354n3k44r8z90m35hm8945vsp95h1-glibc-2.27/lib/libm.so.6 (0x00007f927e00f000)
    libpq.so.5 => not found


I do see a libpq.so file in the postgresql-lib directory on the new host though:

[root@XenonKiloCranberry:~/blog]# ll /nix/store/1m0kd7v8yvf5vdmd2jm16w4aal234114-postgresql-9.6.13-lib/lib/libpq.so
lrwxrwxrwx 1 root root 12 Jan  1  1970 /nix/store/1m0kd7v8yvf5vdmd2jm16w4aal234114-postgresql-9.6.13-lib/lib/libpq.so -> libpq.so.5.9
[root@XenonKiloCranberry:~/blog]# ll /nix/var/nix/profiles/system/sw/lib/libpq.so.5
lrwxrwxrwx 1 root root 80 Jan  1  1970 /nix/var/nix/profiles/system/sw/lib/libpq.so.5 -> /nix/store/1m0kd7v8yvf5vdmd2jm16w4aal234114-postgresql-9.6.13-lib/lib/libpq.so.5

I've got the [glibc gmp5 postgresql postgresql.lib zlib.dev zlib.out] packages installed in my environment.systemPackages.

  • Did you add the directory where libpq.so.5 is located to the LD_LIBRARY_PATH and start a new shell session? – Nasir Riley Jun 9 at 19:46
  • Are you able to compile the executable from source, or is it only available in binary form? – Emmanuel Rosa Jun 10 at 9:35
  • I have the source to recompile yes, I would hope that it would be portable none the less as long as the shared libraries are present? – Chris Stryczynski Jun 10 at 9:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.