1

我正在我的 Centos 5.9 机器上安装 metasploit。在执行捆绑安装时,我在安装 pcaprub 时遇到错误,我尝试将其作为gem install pcaprub单独运行并在此处记录。libpcap-devel-0.9.4-15.el5.i386.rpm 已安装。我潜伏了很多stackoverflow,遗憾的是这是我的第一篇文章。对于我发布的日志,我肯定会遗漏一些基石,所以请不要犹豫,阐明这一点。

gem install pcaprub
Building native extensions.  This could take a while...
ERROR:  Error installing pcaprub:
        ERROR: Failed to build gem native extension.

        /usr/local/bin/ruby extconf.rb

[*] Running checks for pcaprub code...
platform is i686-linux
checking for pcap_open_live() in -lpcap... yes
checking for pcap_setnonblock() in -lpcap... yes
creating Makefile

make
compiling pcaprub.c
pcaprub.c: In function 'Init_pcaprub':
pcaprub.c:954: error: 'PCAP_ERROR' undeclared (first use in this function)
pcaprub.c:954: error: (Each undeclared identifier is reported only once
pcaprub.c:954: error: for each function it appears in.)
pcaprub.c:955: error: 'PCAP_ERROR_BREAK' undeclared (first use in this function)
pcaprub.c:956: error: 'PCAP_ERROR_NOT_ACTIVATED' undeclared (first use in this function)
pcaprub.c:957: error: 'PCAP_ERROR_ACTIVATED' undeclared (first use in this function)
pcaprub.c:958: error: 'PCAP_ERROR_NO_SUCH_DEVICE' undeclared (first use in this function)
pcaprub.c:959: error: 'PCAP_ERROR_RFMON_NOTSUP' undeclared (first use in this function)
pcaprub.c:960: error: 'PCAP_ERROR_NOT_RFMON' undeclared (first use in this function)
pcaprub.c:961: error: 'PCAP_ERROR_PERM_DENIED' undeclared (first use in this function)
pcaprub.c:962: error: 'PCAP_ERROR_IFACE_NOT_UP' undeclared (first use in this function)
pcaprub.c:969: error: 'PCAP_WARNING' undeclared (first use in this function)
pcaprub.c:970: error: 'PCAP_WARNING_PROMISC_NOTSUP' undeclared (first use in this function)
make: *** [pcaprub.o] Error 1


Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/pcaprub-0.11.3 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/pcaprub-0.11.3/ext/pcaprub/gem_make.out
4

2 回答 2

7

我使用了以下命令,它似乎修复它所以运行

apt-get install libpcap-dev

运行后我就可以使用了

gem install pcaprub

没有任何问题。

于 2016-04-10T09:56:00.040 回答
0

我遇到了同样的问题,花了一段时间才弄清楚出了什么问题。
如果您使用 yum 安装它,我相信 libpcap 的标头有点旧。

因此,删除它并手动构建它。

yum remove libpcap*
wget http://www.tcpdump.org/release/libpcap-1.5.3.tar.gz
tar -xf libpcap-1.5.3.tar.gz
cd libpcap-1.5.3
./configure
make
make install

编辑:我还必须重新安装 ncap 才能让一切正常工作。

于 2014-01-15T20:41:33.620 回答