解决 Failed to initialize NSS library 的问题

今天安装 Oracle 依赖的时候,不小心连带升级了 nss-softokn-freebl,导致 yum 和 rpm 命令执行的时候报 Failed to initialize NSS library 的错误:

依赖安装过程中顺带将 nss-softokn-freebl 也升级了

问题重现

1
2
# 执行 yum 报错
[root@three30 sbin]# yum -y install gcc 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.

解决方案

根据红帽官方提供的解决方案,解决办法如下:

1
2
3
4
wget https://www.huangzz.xyz/wp-content/uploads/MyUploads/libnspr4.so.tar
tar xf libnspr4.so.tar
sudo mv libnspr4.so /usr/lib64/
sudo yum install glibc.i686 nspr