![在 CentOS (Amazon AMI) 上重新安装 NSS 库](https://linux22.com/image/9124/%E5%9C%A8%20CentOS%20(Amazon%20AMI)%20%E4%B8%8A%E9%87%8D%E6%96%B0%E5%AE%89%E8%A3%85%20NSS%20%E5%BA%93.png)
我在从 Amazon (S3) 更新 CentOS AMI 上的软件包时遇到了问题。
我收到了一堆重复的包裹。他们之中:
nss-softokn-freebl-3.16.2.3-14.2.38.amzn1.x86_64 is a duplicate with nss-softokn-freebl-3.16.2.3-1.13.amzn1.x86_64
我已经删除了重复项rpm -e nss-softokn-freebl-3.16.2.3-14.2.38.amzn1.x86_64
这导致yum
,rpm
和其他命令立即停止工作,并出现如下错误:
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.6.9 (unknown, Mar 28 2014, 00:06:37) [GCC 4.8.2 20131212 (Red Hat 4.8.2-7)]
If you cannot solve this problem yourself, please go to the yum faq at: http://yum.baseurl.org/wiki/Faq
rpm
→error: Failed to initialize NSS library
ETC。
知道如何在没有命令的情况下修复服务器(重新安装nss-softokn-freebl-3.16.2.3-14.2.38.amzn1.x86_64
)吗? (显然也取决于 NSS)?rpm
rpm2cpio
或者让Python使用其他安装的NSS版本?
答案1
今天我遇到了类似的问题。
我使用 rpm -e --nodeps sqlit ...rpm 然后出现如下问题。
# rpm
error: Failed to initialize NSS library
这个链接帮助我摆脱了麻烦。 https://ask.fedoraproject.org/en/question/75684/how-to-recover-yumdnfrpm-after-uninstall-sqlite/
核心命令在这里:
“sqlite-3.8.10.2-1.fc22.x86_64.rpm” 只是作为演示 rpm。
# rpm2cpio sqlite-3.8.10.2-1.fc22.x86_64.rpm | cpio -idmv
Retrieving the sqlite-3.8.10.2-1.fc22.x86_64.rpm package to cpio format.
#rpm -ivh sqlite
Install sqlite
然后你的rpm/yum/dnf就会回来。