Sendmail error: error while loading shared libraries: libnsl.so.2: cannot open shared object file: No such file or directory

I am trying to use sendmail in a bash script to send an email to my gmail account upon the completion of a task (Rsync of a folder to remote drive). When I invoke sendmail from the command line I get the above error message.

When I use “find” and also “locate” from the command line then find no files named libnsl.so.*.

Yet when I use the “Add Remove Software” desktop application and search for libnsl it returns libnsl 2.0.0-1 and lib32-libsnl 2.0.0-1. If I click on libnsl 2.0.0-1 and look at the files it includes libnsl.so and libnsl.so.3 and libnsl.so.3.0.0

The error message above says sendmail is looking for libnsl.so.2

I have used the command pamac update and pamac upgrade from the command line and they both return that I am up to date.

Can someone help with this error.

Thanks in advance for your help.

Chuck

[nx-74205:/dev/pts/3][/home/aragorn]
[01:21:55][aragorn] >  ll /usr/lib/libnsl*
-rwxr-xr-x 1 root root 96432 May 12  2021 /usr/lib/libnsl-2.33.so
lrwxrwxrwx 1 root root    15 Aug 20 00:06 /usr/lib/libnsl.so -> libnsl.so.3.0.0
lrwxrwxrwx 1 root root    14 May 12  2021 /usr/lib/libnsl.so.1 -> libnsl-2.33.so
lrwxrwxrwx 1 root root    15 Aug 20 00:06 /usr/lib/libnsl.so.3 -> libnsl.so.3.0.0
-rwxr-xr-x 1 root root 30544 Aug 20 00:06 /usr/lib/libnsl.so.3.0.0

[nx-74205:/dev/pts/3][/home/aragorn]
[01:22:20][aragorn] >

Most of those files are symlinks. Try symlinking /usr/lib/libnsl.so.2 to /usr/lib/libnsl.so.3. :arrow_down:

ln -s /usr/lib/libnsl.so.3 /usr/lib/libnsl.so.2

This worked!! Thank you for your instructions! Now when I call “sendmail” from the command line I get no error message other than I must have a recipient. I will move on from here. Again thanks for your help!

Note that your response should be marked as a “solution” and this post marked as “resolved”.

1 Like

While this work, the real solution is to re-build sendmail against the new
libnsl.so version

From which package come sendmail?

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.