yum无法正常使用

用yum安装几个软件后,再次用yum安装软件时,报错:

[root@compute1 bin]# 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, Nov 20 2015, 02:00:19) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)]


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

从网上找到这种方法解决了:

1.下载一个软件

[root@compute1 bin]# wget http://mirror.centos.org/centos/7/os/x86_64/Packages/nspr-4.13.1-1.0.el7_3.x86_64.rpm

2.安装软件

[root@compute1 bin]# rpm2cpio nspr-4.13.1-1.0.el7_3.x86_64.rpm | cpio -idmv

3.安装软件

[root@compute1 bin]# LD_PRELOAD=./usr/lib64/libnspr4.so yum update nspr --nogpgcheck

再次运行yum成功!

注意,如果运行第三步出现错误,请把--nogpgcheck去掉。


猜你喜欢

转载自blog.csdn.net/zss131456/article/details/78231617