yum: TypeError: rpmdb open failed

Run the below command to resolve this issue.

rm /dev/urandom
mknod -m 644 /dev/urandom c 1 9

yum should start working correctly now.