概述

由于系统被前同事升级过python,导致python依赖有问题致使yum不可用。

[root@localhost ~]# yum list wget
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/rpm/_rpm.so: undefined symbol: rpmpkgVerifySigs

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, Feb 11 2014, 07:46:25) 
[GCC 4.8.2 20140120 (Red Hat 4.8.2-13)]

If you cannot solve this problem yourself, please go to 
the yum faq at:
  http://yum.baseurl.org/wiki/Faq

解决办法

查询rpm-python版本信息,并进行卸载

[root@localhost ~]# rpm -q rpm-python
rpm-python-4.11.1-16.el7.x86_64
[root@localhost ~]# rpm -e rpm-python --nodeps

下载并安装与原版本一致的rpm包

[root@localhost ~]#  wget https://buildlogs.centos.org/c7.00.03/rpm/20140609184502/4.11.1-16.el7.x86_64/rpm-python-4.11.1-16.el7.x86_64.rpm --no-check-certificate
[root@localhost ~]# rpm -ivh rpm-python-4.11.1-16.el7.x86_64.rpm
准备中...                          ################################# [100%]
正在升级/安装...
   1:rpm-python-4.11.1-16.el7         ################################# [100%]
[root@localhost ~]# yum clean all
其他解决

如上述操作过程无法解决问题,可尝试重新安装

rpm -Uvh rpm-libs-xxxxxx.rpm --nodeps
rpm -Uvh rpm-xxxxxx.rpm --nodeps
rpm -Uvh rpm-build-xxxxxx.rpm --nodeps
rpm -Uvh rpm-python-xxxxxx.rpm --nodeps
rpm -Uvh rpm-sign-xxxxxx.rpm --nodeps

验证

[root@localhost ~]# yum list wget
已加载插件:fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
Determining fastest mirrors
已安装的软件包
wget.x86_64                                                                                                  1.14-10.el7                                                                                                       @anaconda/7.0
可安装的软件包
wget.x86_64                                                                                                  1.14-15.el7_4.1                                                                                                   base
END

本文标题:Centos7 _rpm.so: undefined symbol: rpmpkgVerifySigs故障解决

本文作者:宇宙最帅的男人

本文链接:https://lolicp.com/linux/202111322.html

版权声明:转载或者引用本文内容请注明来源及原作者,本文著作权归作者 (宇宙最帅的男人) 所有。

除非另有说明,本作品采用知识共享署名-非商业性使用-相同方式共享 4.0 国际许可协议

最后修改:2021 年 11 月 30 日
如果觉得我的文章对你有用,请随意赞赏