解决OSError: [Errno 2] No such file or directory: ‘/dev/urandom’

最近自己的CentOS6在yum update以后,所有的yum命令都会遭遇如下错误

Traceback (most recent call last):
  File "/usr/bin/yum", line 4, in 
    import yum
  File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 46, in 
    import tempfile
  File "/usr/lib/python2.6/tempfile.py", line 34, in 
    from random import Random as _Random
  File "/usr/lib/python2.6/random.py", line 873, in 
    _inst = Random()
  File "/usr/lib/python2.6/random.py", line 96, in __init__
    self.seed(x)
  File "/usr/lib/python2.6/random.py", line 110, in seed
    a = long(_hexlify(_urandom(16)), 16)
OSError: [Errno 2] No such file or directory: '/dev/urandom'

解决方法:

mknod -m 644 /dev/urandom c 1 9

One thought on “解决OSError: [Errno 2] No such file or directory: ‘/dev/urandom’

发表评论

您的电子邮箱地址不会被公开。