Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 187, in getOptionsConfig
    self.conf
  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

 
discard

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

Browse other questions tagged or ask your own question.