yum 使用报错(ModuleNotFoundError: No module named '_error')解决方案

举报
liangbaoyang 发表于 2021/09/06 11:39:16 2021/09/06
【摘要】 yum 使用报错(ModuleNotFoundError: No module named '_error')解决方案

操作系统:openEuler 20.03

问题:yum 使用报错,报错信息如下:

[root@localhost openssl-1.1.1a]# yum
Traceback (most recent call last):
  File "/usr/lib64/python3.7/site-packages/libdnf/error.py", line 14, in swig_import_helper
    return importlib.import_module(mname)
  File "/usr/lib64/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 670, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 583, in module_from_spec
  File "<frozen importlib._bootstrap_external>", line 1043, in create_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
ImportError: /usr/lib64/libcurl.so.4: symbol SSLv3_client_method version OPENSSL_1_1_0 not defined in file libssl.so.1.1 with link time reference

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/yum", line 57, in <module>
    from dnf.cli import main
  File "/usr/lib/python3.7/site-packages/dnf/__init__.py", line 30, in <module>
    import dnf.base
  File "/usr/lib/python3.7/site-packages/dnf/base.py", line 29, in <module>
    import libdnf.transaction
  File "/usr/lib64/python3.7/site-packages/libdnf/__init__.py", line 8, in <module>
    from . import error
  File "/usr/lib64/python3.7/site-packages/libdnf/error.py", line 17, in <module>
    _error = swig_import_helper()
  File "/usr/lib64/python3.7/site-packages/libdnf/error.py", line 16, in swig_import_helper
    return importlib.import_module('_error')
  File "/usr/lib64/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named '_error'

解决方案:

1.查看libssl.so.1.1动态库中是否定义了SSLv3_client_method

nm libssl.so.1.1 | grep SSLv3_client_method

2. 未定义则需要重新编译openssl

wget https://www.openssl.org/source/openssl-1.1.1a.tar.gz
tar -zxvf openssl-1.1.1a.tar.gz
cd openssl-1.1.1a/
./config --prefix=/usr/local/openssl shared enable-ssl3 enable-ssl3-method no-zlib
make -j32
make install

3.查看新编译openssl下libssl.so.1.1动态库是否定义了SSLv3_client_method

/usr/local/openssl/lib
nm libssl.so.1.1 | grep SSLv3_client_method

 

4.将新生成的libssl.so.1.1 替换旧的libssl.so.1.1

参考链接:https://bbs.huaweicloud.com/forum/thread-100729-1-1.html

【版权声明】本文为华为云社区用户转载文章,如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@huaweicloud.com
  • 点赞
  • 收藏
  • 关注作者

评论(0

0/1000
抱歉,系统识别当前为高风险访问,暂不支持该操作

全部回复

上滑加载中

设置昵称

在此一键设置昵称,即可参与社区互动!

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。

*长度不超过10个汉字或20个英文字符,设置后3个月内不可修改。