Curl looking for libldap-2.4.so.2

I ran into an issue where I would try to install a new version of node using nvm, and it would throw an error:

curl: error while loading shared libraries: libldap-2.4.so.2: cannot open shared object file: No such file or directory

For some reason, curl was looking for liblber-2.4.so.2, so I did find a band-aid fix for this issue:

ln -s /usr/lib/libldap.so.2 /usr/lib/libldap-2.4.so.2

and

ln -s /usr/lib/liblber.so.2 /usr/lib/liblber-2.4.so.2

I am just wondering if this is the correct way to fix the issue? I am running the Pinebook Pro. pacman -Syyu does not resolve the issue.

First, make sure you’re fully up to date. See: Pacman-mirrors - Manjaro

You should have libldap 2.6.4-1:

❯ pacman -Fx libldap.so liblber.so
core/libldap 2.6.4-1 [installed]
    usr/lib/libldap.so
    usr/lib/libldap.so.2
    usr/lib/libldap.so.2.0.200
core/libldap 2.6.4-1 [installed]
    usr/lib/liblber.so
    usr/lib/liblber.so.2
    usr/lib/liblber.so.2.0.200

Creating a symlink to the wrong version of a library is a very bad idea and does not “fix” anything.

Alright, I deleted my symlinks, and got this:

$ sudo pacman -Fx libldap.so liblber.so
core/libldap 2.6.3-2 [installed: 2.6.4-1]
    usr/lib/libldap.so
    usr/lib/libldap.so.2
    usr/lib/libldap.so.2.0.200
core/libldap 2.6.3-2 [installed: 2.6.4-1]
    usr/lib/liblber.so
    usr/lib/liblber.so.2
    usr/lib/liblber.so.2.0.200

If you run sudo pacman -Fy to update your local database, your output should be the same as mine above. Either way, you do have libldap 2.6.4-1 installed and should have curl 7.88.1-3.

Please post the command you’re running and post the full output.