I had a problem during updating of the packages on CentOS AMI from Amazon (S3).

I got a bunch of duplicated packages. Among them:

nss-softokn-freebl- is a duplicate with nss-softokn-freebl-

I've removed a duplicate with rpm -e nss-softokn-freebl-

This caused the yum, rpm and other commands to immediately stop working with errors like this:

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

rpmerror: Failed to initialize NSS library


Any idea how to fix the server (reinstall nss-softokn-freebl- without rpm command, rpm2cpio (also depends on NSS apparently)?

Or make Python use the other installed NSS version?

1 Answer 1


Today I meet a similar problems like this.

I use rpm -e --nodeps sqlit ...rpm then the problem occur like below.

# rpm 
error: Failed to initialize NSS library

This link help me out of the trouble. https://ask.fedoraproject.org/en/question/75684/how-to-recover-yumdnfrpm-after-uninstall-sqlite/

The core command is here :

"sqlite-" Just as a demo rpm.

# rpm2cpio sqlite- | cpio -idmv 
Retrieving the sqlite-  package to cpio format.
#rpm -ivh sqlite 
Install sqlite 

Then your rpm / yum / dnf will be back .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .