1

After upgrading to Ubuntu 22.04 when I run the curl command it's giving this error:

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

$ which curl /usr/bin/curl

Before the upgrade, it was working fine.

I removed the curl using apt and then reinstalled it again, but still getting same error. Any idea how to resolve this issue?

with regards, Saravanan

  • 1
    Please [edit] your question to include the output of curl --version. On 22.04, curl should depend (via libcurl4) on libldap-2.5-0 (>= 2.5.4) afaik – steeldriver Jan 31 '23 at 14:39
  • I think the apt cache is outdated and you need to force a full package upgrade. Hence, check if this command works: sudo apt update ; sudo apt autoremove ; sudo apt clean ; sudo apt-get check ; sudo apt full-upgrade curl libcurl4 --reinstall -y – Yuri Sucupira Feb 03 '23 at 21:45

3 Answers3

0

In my case it is impossible do get the version running curl --version because I got the error described above. But when you uninstall and then install curl again, it shows the version it is installing curl (7.85.0-1ubuntu0.2).

Update: I have found a solution, but it involves compile source code. You can follow this steps:

0

I had this same problem and found that there is local curl installed apart from the default install from ubuntu.

use locate libcurl.so

If found any libcurl.so in the /usr/local/lib path just delete them.

Once the duplicate libs are removed the curl command works fine

TommyPeanuts
  • 1,079
0

I used a combination of answers to solve the issue:

zx485
  • 2,426