Yum commands error "pycurl.so: undefined symbol: CRYPTO_set_locking_callback"

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux

Issue

  • When I run yum, following error occurs:

    [root@host tmp]# yum check update
    There was a problem importing one of the Python modules
    required to run yum. The error leading to this problem was:
    
    /usr/lib64/python2.6/site-packages/pycurl.so: undefined symbol: CRYPTO_set_locking_callback
    
    Please install a package which provides this module, or
    verify that the module is installed correctly.
    
    It's possible that the above module doesn't match the
    current version of Python, which is:
    2.6.6 (r266:84292, Sep  4 2013, 07:46:00)
    [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)]
    
    If you cannot solve this problem yourself, please go to
    the yum faq at:
    http://yum.baseurl.org/wiki/Faq
    

Resolution

  • Check and fix the related library paths or remove 3rd party libraries, usually libcurl or libssh2. On a x86_64 system, the standard paths for those libraries are /usr/lib64/libcurl.so.4 and /usr/lib64/libssh2.so.1

  • Third-party libraries may be getting loaded automatically by ldconfig if there are customizations defined in files under /etc/ld.so.conf.d/

  • It's also helpful to check for any LD_LIBRARY variables defined in the environment as these can also take precedence over the OS libraries.

How do I properly set the LD_LIBRARY_PATH environment variable? - Red Hat Customer Portal

Root Cause

  • One or more third party libraries have been installed.

    # ldconfig -p -N -X | grep curl
    libcurl.so.4 (libc6,x86-64) => /usr/lib/libcurl.so.4
    libcurl.so.4 (libc6,x86-64) => /usr/lib64/libcurl.so.4
    libcurl.so (libc6,x86-64) => /usr/lib/libcurl.so
    
    # ldconfig -p -N -X | grep ssh
    libssh2.so.1 (libc6,x86-64) => /lib/libssh2.so.1
    libssh2.so.1 (libc6,x86-64) => /usr/lib64/libssh2.so.1
    libssh2.so (libc6,x86-64) => /lib/libssh2.so
    

Diagnostic Steps

  • Look at the library dependencies using the ldd tool. You can notice that pycurl.so requires libcurl.so.4, which requires libssh2.so.1, which requires libcrypto.so.10 from the OpenSSL library. This last one provides the missing symbol:

    # nm -D /usr/lib64/libcrypto.so.10 | grep -i CRYPTO_set_locking_callback
    000000000006a2e0 T CRYPTO_set_locking_callback
    
  • Output of ldd command in normal system.

    # ldd /usr/lib64/python2.6/site-packages/pycurl.so
    linux-vdso.so.1 =>  (0x00007fff9cb7f000)
    libcurl.so.4 => /usr/lib64/libcurl.so.4 (0x00007fc35da43000)  <<--- proper path
    libpython2.6.so.1.0 => /usr/lib64/libpython2.6.so.1.0 (0x00007fc35d69d000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc35d47f000)
    libc.so.6 => /lib64/libc.so.6 (0x00007fc35d0eb000)
    libidn.so.11 => /lib64/libidn.so.11 (0x00007fc35ceb9000)
    libldap-2.4.so.2 => /lib64/libldap-2.4.so.2 (0x00007fc35cc68000)
    librt.so.1 => /lib64/librt.so.1 (0x00007fc35ca60000)
    libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007fc35c81c000)
    libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007fc35c535000)
    libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007fc35c309000)
    libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007fc35c105000)
    libz.so.1 => /lib64/libz.so.1 (0x00007fc35beee000)
    libssl3.so => /usr/lib64/libssl3.so (0x00007fc35bcaf000)
    libsmime3.so => /usr/lib64/libsmime3.so (0x00007fc35ba83000)
    libnss3.so => /usr/lib64/libnss3.so (0x00007fc35b743000)
    libnssutil3.so => /usr/lib64/libnssutil3.so (0x00007fc35b517000)
    libplds4.so => /lib64/libplds4.so (0x00007fc35b313000)
    libplc4.so => /lib64/libplc4.so (0x00007fc35b10d000)
    libnspr4.so => /lib64/libnspr4.so (0x00007fc35aecf000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007fc35accb000)
    libssh2.so.1 => /usr/lib64/libssh2.so.1 (0x00007fc35aaa2000)
    libutil.so.1 => /lib64/libutil.so.1 (0x00007fc35a89f000)
    libm.so.6 => /lib64/libm.so.6 (0x00007fc35a61b000)
    /lib64/ld-linux-x86-64.so.2 (0x0000003369800000)
    liblber-2.4.so.2 => /lib64/liblber-2.4.so.2 (0x00007fc35a40b000)
    libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fc35a1f1000)
    libsasl2.so.2 => /usr/lib64/libsasl2.so.2 (0x00007fc359fd7000)
    libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007fc359dcb000)
    libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007fc359bc8000)
    libssl.so.10 => /usr/lib64/libssl.so.10 (0x00007fc35995b000)
    libcrypto.so.10 => /usr/lib64/libcrypto.so.10 (0x00007fc359578000)
    libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00007fc359341000)
    libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fc359121000)
    libfreebl3.so => /lib64/libfreebl3.so (0x00007fc358ea8000)
    
  • Output of ldd command in problematic system.

    # ldd /usr/lib64/python2.6/site-packages/pycurl.so
    linux-vdso.so.1 =>  (0x00007fff973ff000)
    libcurl.so.4 => /usr/lib/libcurl.so.4 (0x00007fe0691d1000) <<<----- might be changed.
    libpython2.6.so.1.0 => /usr/lib64/libpython2.6.so.1.0 (0x00007f110b8af000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fc35d47f000)
    libc.so.6 => /lib64/libc.so.6 (0x00007fc35d0eb000)
    librt.so.1 => /lib64/librt.so.1 (0x00007fc35ca60000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007fc35accb000)
    libutil.so.1 => /lib64/libutil.so.1 (0x00007fc35a89f000)
    libm.so.6 => /lib64/libm.so.6 (0x00007fc35a61b000)
    /lib64/ld-linux-x86-64.so.2 (0x0000003369800000)
    
  • Do an strace on the yum command, you'll probably see it pointing to the problem package or file, like:

    open("/usr/lib/libcurl.so.4", O_RDONLY) = 9
    

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments