暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

LInux·使用yum报错“pycurl.so: undefined symbol”

3888

1. 问题概述

在虚拟机安装依赖报错,yum无法使用

[root@VM_0_6_centos ~]# 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, Aug 7 2019, 00:51:29) [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

2. 问题排查

  • 从redhat提供的说明看重点检查和修复 libcurl 或 libssh2 库
    image.png
  • 检查报错的动态库链接
[root@VM_0_6_centos ~]# ldd /usr/lib64/python2.7/site-packages/pycurl.so linux-vdso.so.1 => (0x00007ffcafded000) libcurl.so.4 => /usr/local/pgsql/lib/libcurl.so.4 (0x00007f617ea01000) libpython2.7.so.1.0 => /lib64/libpython2.7.so.1.0 (0x00007f617e635000) libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f617e419000) libc.so.6 => /lib64/libc.so.6 (0x00007f617e04b000) libssl.so.1.1 => /usr/local/pgsql/lib/libssl.so.1.1 (0x00007f617dd9c000) libcrypto.so.1.1 => /usr/local/pgsql/lib/libcrypto.so.1.1 (0x00007f617d87c000) libldap-2.4.so.2 => /usr/local/pgsql/lib/libldap-2.4.so.2 (0x00007f617d625000) libz.so.1 => /usr/local/pgsql/lib/libz.so.1 (0x00007f617d409000) librt.so.1 => /lib64/librt.so.1 (0x00007f617d201000) libdl.so.2 => /lib64/libdl.so.2 (0x00007f617cffd000) libutil.so.1 => /lib64/libutil.so.1 (0x00007f617cdfa000) libm.so.6 => /lib64/libm.so.6 (0x00007f617caf8000) /lib64/ld-linux-x86-64.so.2 (0x00007f617ee83000) liblber-2.4.so.2 => /usr/local/pgsql/lib/liblber-2.4.so.2 (0x00007f617c8e8000) libresolv.so.2 => /lib64/libresolv.so.2 (0x00007f617c6cf000) libsasl2.so.3 => /usr/local/pgsql/lib/libsasl2.so.3 (0x00007f617c4ad000)

结合redhat知识库说明因为:libcurl.so.4 => /usr/local/pgsql/lib/libcurl.so.4 (0x00007f617ea01000)调用导致报错

3. 解决方案

  • 因为虚拟机以前安装过pg,并且该版本已清楚但部分文件并没有删除,所以直接删除目录
[root@VM_0_6_centos ld.so.conf.d]# rm -rf /usr/local/pgsql/ ## 执行ldconfig ,重新生成缓存 [root@VM_0_6_centos ld.so.conf.d]# ldconfig [root@VM_0_6_centos ld.so.conf.d]# yum 已加载插件:fastestmirror, langpacks 您需要给出命令 Usage: yum [options] COMMAND List of Commands: check 检查 RPM 数据库问题 check-update 检查是否有可用的软件包更新 clean 删除缓存数据 deplist 列出软件包的依赖关系 distribution-synchronization 已同步软件包到最新可用版本 downgrade 降级软件包

yum功能恢复正常

4. 知识扩展

ldconfig是一个动态链接库管理命令,为了让动态链接库为系统所共享,还需运行动态链接库的管理命令–ldconfig。

ldconfig 命令的用途,主要是在默认搜寻目录(/lib和/usr/lib)以及动态库配置文件/etc/ld.so.conf 内所列的目录下,搜索出可共享的动态 链接库(格式如前介绍 lib.so),进而创建出动态装入程序(ld.so)所需的连接和缓存文件。缓存文件默认为 /etc/ld.so.cache,此文件保存已排好序的动态链接库名字列表。

ldd是用来查看程序运行所需的共享库,常用来解决程序因缺少某个库文件而不能运行的一些问题。

5. 参考文档

Yum commands error “pycurl.so: undefined symbol: CRYPTO_set_locking_callback”

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论