安装DB2时导致yum损坏解决办法

在安装DB2相关依赖包时,导致yum损坏,相关命令不能使用的解决办法。

2018/05/04 运维 操作系统 Yum

安装DB2时导致yum损坏解决办法

问题描述

在安装DB2相关依赖包时,导致yum损坏,相关命令不能使用。

出现类似下面的错误信息:

error: Failed to initialize NSS library
There was a problem importing one of the Python modules
required to run yum. The error leading to this problem was:

   cannot import name ts

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, Oct 11 2015, 17:47:16) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)]

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

解决办法

  1. 下载 nspr( nspr-4.13.1-1.0.el7_3.x86_64.rpm )包
  2. 执行命令:
rpm2cpio nspr-4.13.1-1.0.el7_3.x86_64.rpm | cpio -idmv
  1. 执行命令:
LD_PRELOAD=./usr/lib64/libnspr4.so yum update nspr

注意事项

如果还报错,可以将 export LD_PRELOAD=/usr/lib64/libnspr4.so 写入 /etc/profile ,然后再 source /etc/profile

Search

    Table of Contents