ubuntu12.04TLS下源码编译安装wireshark

 ubuntu12.04TLS下源码编译安装wireshark
2015-10-17 00:12:37
原创作品,允许转载,转载时请务必以超链接形式标明文章  原始出处 、作者信息和本声明。否则将追究法律责任。 http://happytree007.blog.51cto.com/6335296/1703693

一、环境以及一些源码说明

     系统:ubuntu12.04TLS 64位

     源码:wireshark-1.12.7.tar.bz2,libtool-2.4.6.tar.gz ,libpcap-1.7.4.tar.gz 

     安装路径: /opt/wireshark


二、安装步骤

    1. 首先安装一些依赖的工具以及库

        sudo apt-get update 先更新下软件镜像站点

         sudo apt-get install flex

         sudo apt-get install bison

         sudo apt-get install autoconf

         sudo apt-get install libqt4-dev

         sudo apt-get install libgtk2.0-dev

        安装libtool(使用源码安装):

            (1)解压$tar -xzf libtool-2.4.6.tar.gz

            (2)进入解压后的目录 $cd libtoo-2.4.6

            (3) 安装三部曲 $./configure; make ; sudo make install


     2.安装libcap

            (1) 解压 $tar -xzf libpcap-1.7.4.tar.gz

            (2) 进入解压后的目录 $cd libpcap-1.7.4

            (3) $./configure

            (4) $make 

            (5) $sudo make install

     3.然后解压wiresharek源码,进入解压目录,进行安装三部曲。

            (1) $tar -xjf wiresharek-1.12.7.tar.bz2

            (2) $cd wiresharek-1.12.7

            (3) $./configure --prefix=/opt/wireshark --with-gtk2 (因为默认使用gtk3,所以指定使用gtk2)

            (4) $make 

            (5) $sudo make install


    三、安装过程中遇到的问题以及解决方法

        (1)安装libpcap时

               <1> $./configure

                    报错:

                    checking for flex... no

                    checking for bison... no

                    checking for capable lex... insufficient

                    configure: error: Your operating system's lex is insufficient to compile

                    libpcap.  flex is a lex replacement that has many advantages, including

                    being able to compile libpcap.  For more information, see

                    http://www.gnu.org/software/flex/flex.html . 

                    解决:

                   $sudo apt-get install flex

              <2>$make 

                    报错:

                    ./runlex.sh lex -oscanner.c scanner.l

                    mv scanner.c scanner.c.bottom

                    cat ./scanner.c.top scanner.c.bottom > scanner.c

                    yacc -d grammar.y

                    make: yacc:命令未找到

                    make: *** [grammar.c] 错误 127

                    解决:

                   $sudo apt-get install bison

        (2)编译wireshark

            <1>$./autogen.sh

                报错:

                 ./autogen.sh: 1: ./autogen.sh: autoconf: not found 

                 You must have autoconf 2.60 or later installed to compile Wireshark.

                 Download the appropriate package for your distribution/OS,

                 or get the source tarball at ftp://ftp.gnu.org/pub/gnu/autoconf/

                ./autogen.sh: 1: ./autogen.sh: automake: not found

                 You must have automake 1.9 or later installed to compile Wireshark.

                 Download the appropriate package for your distribution/OS,

                 or get the source tarball at ftp://ftp.gnu.org/pub/gnu/automake/

                ./autogen.sh: 1: ./autogen.sh: libtool: not found

                 You must have libtool 1.4 or later installed to compile Wireshark.

                 Download the appropriate package for your distribution/OS,

                 or get the source tarball at ftp://ftp.gnu.org/pub/gnu/libtool/

                解决:

                $sudo apt-get insall autoconf

                安装libtool

            <2>$./configure --prefix=/opt/wireshark

                报错:

                checking for pkg-config... /usr/bin/pkg-config

                checking for Qt5Core - version >= 4.6.0... no

                checking for QtCore - version >= 4.6.0... no

                configure: error: Qt is not available

                解决:

                $sudo apt-get install libqt4-dev

            

                再次运行$./configure –-prefix=/opt/wireshark    

                报错:

                gtk+3 no available

                解决:

                $sudo apt-get install libgtk2.0-dev 第一次没有找到

                $sudo apt-get update 更新镜像站点,找到

                $sudo apt-get install libgtk2.0-dev

                

                再次运行$./configure --prefix=/opt/wireshark

                依然报错 gtk+3 no available

                解决: 

                    $./configure --prefix=/opt/wireshark --with-gtk2


本文出自 “风雪舞者” 博客,请务必保留此出处http://happytree007.blog.51cto.com/6335296/1703693

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值