# yum
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:
/usr/lib64/python2.7/site-packages/pycurl.so: undefined symbol: CRYPTO_num_locks
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.7.5 (default, May 1 2020, 22:27:31)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-39)]
If you cannot solve this problem yourself, please go to
the yum faq at:
http://yum.baseurl.org/wiki/Faq
最近升级了openssl后发现yum不可用了,排查下原因修复yum。这里提示了/usr/lib64/python2.7/site-packages/pycurl.so: undefined symbol: CRYPTO_num_locks
检查ld.so.conf
# cat /etc/ld.so.conf
include ld.so.conf.d/*.conf
没有引入其它lib库目录,没有问题,如果这里有其它的lib库目录,删除后需要使用ldconfig更新一下cache
使用ldconfig
# ldconfig -p | grep libcurl
libcurl.so.4 (libc6,x86-64) => /lib/libcurl.so.4
libcurl.so (libc6,x86-64) => /lib/libcurl.so
这里libcurl库的版本一致,没有问题,如果这里版本不一致,删除低版本的so
使用ldd
# ldd /usr/lib64/python2.7/site-packages/pycurl.so
linux-vdso.so.1 => (0x00007ffd633f5000)
/$LIB/libonion.so => /lib64/libonion.so (0x00007f21e2b18000)
libcrypto.so.1.1 => /lib/libcrypto.so.1.1 (0x00007f21e22f6000)
libssl.so.1.1 => /lib64/libssl.so.1.1 (0x00007f21e2063000)
libcurl.so.4 => /lib/libcurl.so.4 (0x00007f21e1de2000)
libpython2.7.so.1.0 => /lib64/libpython2.7.so.1.0 (0x00007f21e1a16000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f21e17fa000)
libc.so.6 => /lib64/libc.so.6 (0x00007f21e142b000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007f21e1227000)
libz.so.1 => /lib64/libz.so.1 (0x00007f21e1011000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007f21e0e0e000)
libm.so.6 => /lib64/libm.so.6 (0x00007f21e0b0c000)
/lib64/ld-linux-x86-64.so.2 (0x00007f21e29ff000)
这里pycurl.so依赖的动态库也都有,没有问题,如果找不到动态库需要补全
重新构建pycurl
# wget https://pypi.python.org/packages/source/p/pycurl/pycurl-7.43.0.3.tar.gz
# tar -zxvf pycurl-7.43.0.3.tar.gz
# which curl-config
/usr/bin/curl-config
# python setup.py install --curl-config=/usr/bin/curl-config
后来想到升级了openssl,但是pycurl并没有重新构建,于是重新构建就好了