我正在开发一个项目,该项目需要将所有第三方(阅读:CPAN)perl 模块安装在 perforce 存储库中,以便任何依赖于它们的代码都可以成功运行,而无需其他任何人手动安装它们。我在尝试安装 XML::Parser 时遇到了一个问题。我使用 cpanminus 来安装我的 CPAN 模块,所以我cpanm -L . XML::Parser
在所需的目录中运行(这在以前与其他模块一起使用过)并得到了错误:
Expat.xs:12:19: error: expat.h: No such file or directory
我习惯使用 Ubuntu 和 apt-get,但在工作中我必须使用 RedHat,而且我不确定如何将 expat 安装到本地目录。我跑了yum search expat
,得到了
expat.i386 : A library for parsing XML.
expat.x86_64 : A library for parsing XML.
所以我尝试yum install --installroot=. expat.i386
并得到以下错误:
Loaded plugins: rhnplugin, security
error: cannot open Packages index using db3 - No such file or directory (2)
error: cannot open Packages database in ./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 804, in readMainConfig
yumvars['releasever'] = _getsysver(startupconf.installroot, startupconf.distroverpkg)
File "/usr/lib/python2.4/site-packages/yum/config.py", line 877, in _getsysver
idx = ts.dbMatch('provides', distroverpkg)
TypeError: rpmdb open failed
我究竟做错了什么?此外,一旦我安装了 expat,我不确定如何告诉 cpanm 在哪里可以找到它。