应该算是原创吧。。。
最近由于项目原因要学sniffit, 然后书上和网上关于安装的介绍是这样的
./configure && make ,只要在这个过程中没有error出现,就成功了
然后error信息就出现了,没有找到完整的安装过程,可能是Users基本都能安装成功吧。发一下安装过程,对自己安装过程中出现的error的解决办法,主要是引用各种网上的资料,不过应该算是原创吧。。。
本来装的是16.04LTS,但是安装失败,而且iNode也装不上,上网不便,于是换了14.04LTS。没想到还是这么多error,所幸iNode装上了。
初学ubuntu,遇到很多问题,虽然网上都能找到解决方案,但是对于自己的情况并不都能适用,所以还是记录一下。
首先这个方法是适用的http://www.linuxdiyf.com/linux/17464.html,但是装下来之后我不知道源码在哪里,而且使用的时候还是有些问题,只抓到了ICMP,所以继续尝试从源码安装
在ubuntu 14.04LTS 下安装sniffit.0.3.7 Beta
解压后./configure发现错误:
checking host/target/build system type ... Invalid configuration 'x86_64-pc-linux-gnu':machine 'x86_64-pc' not recognized
NOT A SUPPORTED SYSTEM / OR SYSTEM NOT RECOGNISED
这个blog总结了三种方法
http://blog.youkuaiyun.com/php_boy/article/details/7382998
看了之后发现自己没有装libtool, 第三种方法最简单,试了下发现失败。
然后试下第一种方法,装上libtool
sudo apt-get install libtool
发现config.guess config.sub 放在/usr/share/libtool 下
sudo cp /usr/share/libtool/config/config.guess ~/download/sniffit.0.3.7.beta/
sudo cp /usr/share/libtool/config/config.sub ~/download/sniffit.0.3.7.beta/
继续./configure
仍然有
checking host/target/build system type ... Invalid configuration 'x86_64-pc-linux-gnu':machine 'x86_64-pc' not recognized
但是不报NOT A SUPPORTED SYSTEM / OR SYSTEM NOT RECOGNISED
,继续完成配置
creating ./config.status
creating Makefile
但是make的时候发生了错误
yacc -d grammar.y
make[1]: yacc: 命令未找到
make[1]: *** [grammar.c] 错误 127
gcc -w -O2 -o sniffit sniffit.0.3.7.c sn_packets.o sn_generation.o sn_interface.o sn_cfgfile.o sn_logfile.o sn_resolv.o -I./libpcap -L./libpcap -lpcap -DHAVE_SHMGET=1 -DHAVE_ATEXIT=1 -DSIZEOF_UNSIGNED_SHORT_INT=2 -DSIZEOF_UNSIGNED_LONG_INT=8 -DSIZEOF_UNSIGNED_INT=4 -DUSE_32_INT=1 -DLINUX=1
/usr/bin/ld: 找不到 -lpcap
collect2: error: ld returned 1 exit status
make: *** [sniffit] 错误 1
然后又看了http://www.cnblogs.com/xwdreamer/p/3623454.html发现还要装个build-essential, 装上之后编译仍然出错
找到一个linux命令make报错总结:
http://www.linuxidc.com/Linux/2011-12/50152.htm
sudo apt-get install bison
,然后就可以编译了
尝试第二种方法 bash fix_x86_64-unknown-linux-gnu.sh,报错:
aclocal: 未找到命令
aclocal failed
看了http://bbs.chinaunix.net/thread-2106703-1-1.html,把automake && autoconf 装上
sudo apt-get install automake
再运行,报错:
aclocal: warning: autoconf input should be named 'configure.ac' not 'configure.in'
autoheader: error: AC_CONFIG_HEADERS not found in configure.in
autoheader failed
然后找到下面的回答 http://lists.gnu.org/archive/html/autoconf/2005-08/msg00025.html
暂时没有尝试
make clean发现会把sniffit也删掉
这样就装完了,但是sniffit运行还是有问题
运行时显示 段错误(核心已转储)
不知是何原因?