/usr/local/bin/curl: symbol lookup error: /usr/local/bin/curl: undefined symbol: curl_mime_free

websafe

Verified User
Joined
Jun 15, 2010
Messages
103
Location
Opole, PL
Hello,

after upgrading curl
Code:
./build curl
/usr/local/bin/curl throws the following error:

Code:
# /usr/local/bin/curl
curl: try 'curl --help' or 'curl --manual' for more information
/usr/local/bin/curl: symbol lookup error: /usr/local/bin/curl: undefined symbol: curl_mime_free

and this causes a problem when I try to generate Let'sEncrypt certificates.

Is there a known way to fix /usr/local/bin/curl?

Running `LD_LIBRARY_PATH=/usr/local/lib /usr/local/bin/curl` works fine, but tha't not really what we want, right?
 
Last edited:
Your issue is that you built curl using the libraries in /usr/local/lib but when running it, it is defaulting to using the existing $LD_LIBRARY_PATH or the built in system locations (i.e. /lib, /lib64, /usr/lib, /usr/lib64). If you have a package of curl that was installed with your distsro, then I recommend you remove the distro one and continue using the version in /usr/local, or make sure your LD_LIBRARY_PATH always contains /usr/local/lib earlier in the path than the system locations.
 
@toml Is it safe to remove the curl package from my distro? https://help.directadmin.com/item.php?id=354 requires to install libcurl-devel...

I'm on CentOS 6.10 and my /etc/ld.so.conf contains:
Code:
# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/lib64
/usr/local/lib

I could nowhere find th requirement that I should place /usr/local/lib before all other entries in ld.so.conf. Is this the case?
 
Don't add it to your ld.so.conf that could potentially break some system applications. I suggest that you update the scripts that call curl to insert the LD_LIBRARY_PATH. I have looked at my system (CentOS 7) and I have curl installed via rpm but I noticed that my custombuild didn't build a version of curl in /usr/local. I do have curl=yes in my options.conf but it still doesn't seem to have actually done the build.
 
@toml I don't think that updating all script using curl whith LD_LIBRARY_PATH is the solution. This error breaks for example the ftp_upload script and others in /usr/local/directadmin/scripts so I would have to make sure after every update these scripts are still working as expected...
 
So I have found a solution that works, but every time I'll upgrade curl I will have to compile curl twice.

The first time with /usr/local/directadmin/custombuild/configure/curl/configure.curl containing:
Bash:
#!/bin/sh
./configure --with-nghttp2

so /usr/local/lib/libcurl* is created as expected by others, and then the second time with configure.curl containing:
Code:
#!/bin/sh
./configure --disable-shared --with-nghttp2

to create a working curl binary "linked" against the correct libcurl.
 
Last edited:
Back
Top