Problem

Following problem is occurring on one of the VPS:

# yum update

Loaded plugins: allowdowngrade, fastestmirror
error: no dbpath has been set
error: cannot open Packages database in /%{_dbpath}
Traceback (most recent call last):
  File "/usr/bin/yum", line 29, in ?
	yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 229, in user_main
	errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 84, in main
	base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 184, in getOptionsConfig
	enabled_plugins=self.optparser._splitArg(opts.enableplugins))
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 191, in _getConfig
	self._conf = config.readMainConfig(startupconf)
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 754, in readMainConfig
	yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 824, in _getsysver
	idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed

The solution consists of (re)creating the /dev/urandom device on the OpenVZ hardware node:

# vzctl stop 102
Stopping container ...
Container was stopped
Container is unmounted

# mknod --mode 644 /vz/private/102/lib/udev/devices/urandom c 1 9
# vzctl enter 102
# ls -l /vz/private/102/lib/udev/devices/urandom
crw-r--r-- 1 root root 1, 9 Jul 12 21:52 /vz/private/102/lib/udev/devices/urandom

# vzctl start 102

Leave a comment