我正在開發一個需要將所有第三方(讀取:CPAN)perl模塊安裝到perforce存儲庫中的項目,以便任何依賴於它們的代碼都可以成功運行,無需其他人需要手動安裝它們。我嘗試安裝XML :: Parser時遇到了一個問題。我用cpanminus安裝我CPAN模塊,所以我跑了所需的目錄cpanm -L . XML::Parser
(這與其他模塊工作過),並得到了錯誤:安裝XML :: Parser需要expat.h
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在哪裏找到它。
我試過'百勝安裝--installroot = [絕對路徑]外籍-devel'和它說'不package expat-devel available.'事實上,即使我用expat.i386試用它,我也會得到相同的錯誤 – Lorkenpeist 2013-03-18 19:46:47
你使用的是什麼版本的紅帽?我看到了Red Hat Enterprise Linux Server 5.9(Tikanga)和Fedora 17(Beefy Miracle)的expat-devel。也許這是你的rpmdb的另一個問題? – SES 2013-03-18 19:50:36
'lsb_release -i -r'說'分銷商ID:RedHatEnterpriseServer版本:5.6' – Lorkenpeist 2013-03-18 20:21:44