Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm building a miniminal Centos5 for use in xen but i having problems when go to use yum

this are the steps:

$ mkdir -p images/x86_64/5
$ cd images/x86_64/5
$ mkdir -p proc etc dev var/{cache,log,lock/rpm} sys
# yum -c yum.conf --installroot=images/x86_64/5 -y groupinstall Base

the last command throw the following error:

error: could not open Packages index using db3 - No such file or directory (2)
error: can not open Packages database in images/x86_64/5/var/lib/rpm
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 309, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 157, in main
  File "/usr/share/yum-cli/cli.py", line 187, in getOptionsConfig
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 665, in <lambda>
    conf = property(fget=lambda self: self._getConfig(),
  File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 240, in _getConfig
    self._conf = config.readMainConfig(startupconf)
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 805, in readMainConfig
    yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
  File "/usr/lib/python2.4/site-packages/yum/config.py", line 878, in _getsysver
    idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed

How i can solve this?

share|improve this question
What are the values of $yumfile and $base? – peterph Jan 16 '13 at 1:08
I've edited in my question – rkmax Jan 16 '13 at 4:20
By starting the machine and installing normally? It isn't so simple to set up what yum requires to run. Just creating a bunch of directories definitely isn't enough. – vonbrand Jan 21 '13 at 5:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.