View Issue Details

IDProjectCategoryView StatusLast Update
0014767CentOS-7rpmpublic2018-05-14 13:03
Status newResolutionopen 
Platformx86_64OSOS Version
Product Version7.5.1804 
Target VersionFixed in Version 
Summary0014767: Building new CentOS installation - rpm doesn't work
DescriptionWhen 7.5 was pushed yesterday, rpm and yum started failing on new system builds with:

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:

Recommended workarounds of installing 4.13.1 of the nspr package doesn't fix the issue
Steps To ReproduceStart with a fresh disk mounted at $FULL_RAWDIR

  mkdir -p $FULL_RAWDIR/var/lib/rpm
  sudo rpm --rebuilddb --root=$FULL_RAWDIR
  sudo rpm --root=$FULL_RAWDIR --import RPM-GPG-KEY-CentOS-7
  sudo rpm -i --root=$FULL_RAWDIR --nodeps centos-release-7-3.*.rpm
  sudo yum --installroot=$FULL_RAWDIR -y clean all
  sudo yum --installroot=$FULL_RAWDIR -y update
  sudo yum --installroot=$FULL_RAWDIR install -y rpm-build yum
  sudo yum --installroot=$FULL_RAWDIR install -y sudo ca-certificates kernel-devel openssh grub2 bios-grub dracut util-linux kmod lvm2 dosfstools

  sudo chroot $FULL_RAWDIR yum -y install automake
Additional InformationThis process worked fine before 7.5 was pushed.
TagsNo tags attached.




2018-05-11 08:45

reporter   ~0031756

just running rpm or yum will cause the issue...e.g.,

sudo chroot $FULL_RAWDIR rpm -vv --rebuilddb

Fails as well as the steps to reproduce


2018-05-12 18:10

reporter   ~0031780

Hi, I fixed this issue by adding:

mknod -m 644 $FULL_RAWDIR/dev/urandom c 1 9

RPM (or NSS) in CentOS 7.5.1804 seems to fail when /dev/urandom is not available in a chroot.
"sudo chroot $FULL_RAWDIR strace rpm" shows the dependency on /dev/urandom nicely.


2018-05-12 18:17

manager   ~0031781

More likely the correct solution is to bind mount /proc /dev and /sys from the host system onto your chroot directory before you chroot into it.


2018-05-14 13:03

reporter   ~0031793

Genius! Thank you that was the issue.

Issue History

Date Modified Username Field Change
2018-05-11 08:38 cp-jpatterson New Issue
2018-05-11 08:45 cp-jpatterson Note Added: 0031756
2018-05-12 18:10 karelklic Note Added: 0031780
2018-05-12 18:17 TrevorH Note Added: 0031781
2018-05-14 13:03 cp-jpatterson Note Added: 0031793