构建最小的centos

构建最小的centos

我正在构建一个在 Xen 中使用的最小 Centos5,但是当我使用 yum 时遇到问题。

这些是步骤:

$ 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

最后一个命令抛出以下错误:

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

我该如何解决这个问题?

相关内容