大网数据广告活动
服务器运维问答

yum/rpm Failed to initialize NSS library in chroot

· 52CE 我爱测

I am performing a yum update from CentOS 7.4 to CentOS 7.5, when nspr and nss soft-softoken receive the updates, I am left with the following error: yum update nspr error: Failed to initialize NSS library There was a problem impo…

问题原文

原帖链接 · Arlion · CC BY-SA 4.0

I am performing a yum update from CentOS 7.4 to CentOS 7.5, when nspr and nss soft-softoken receive the updates, I am left with the following error:

yum update nspr
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, Apr 11 2018, 07:36:10) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]

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

The packages that are updated to:

nss                         3.34.0-4.el7                                           
nss-softokn                 3.34.0-2.el7                                           
nss-softokn-freebl          3.34.0-2.el7                                           
nss-sysinit                 3.34.0-4.el7                                           
nss-tools                   3.34.0-4.el7                                           
nss-util                    3.34.0-2.el7  

Troubleshoot attempts: It should be noted by the reader, the upgraded filesystem is version controlled. Each of the following steps were performed at the same point in time, and reverted before moving on to the next troubleshooting step.

Each of these articles and solutions have not provided fix my particular issue.

Thank you for your time.

已采纳解答

原帖链接 · Arlion · CC BY-SA 4.0

Special thank you to TrevorH and jhodrien on #centos.

The problem was that chroot prevents access to /dev/urandom (as desgined). The update installed to succeeded required those random bits to initialize GnuTLS.

The solution is:

mount -o bind /dev dev/

to the chroot and proceed with the update as usual.

Or if you don't want to mount the entire /dev directory, you may create your own!

mknod -m 666 /dev/random c 1 8
mknod -m 666 /dev/urandom c 1 9

Problem fixed.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-05-11)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。