error while loading shared libraries: libpcap.so.1: cannot open shared object file: No such file or

由于yum install iftop提示没有资源,所以直接上传一个iftop命令到/usr/local/bin,但是执行的时候出现

iftop: error while loading shared libraries: libpcap.so.1: cannot open shared object file: No such file or directory

执行步骤如下:

1.安装GCC:

  yum -y install gcc-c++

2.安装flex: 

  yum -y install flex 

  没有flex,直接安装libpcap会提示"Your operating system‘s lex is insufficient to compile libpcap"错误;

3.安装bison

  yum -y install bison

  前面安装的是flex,就需要搭配bison,如不会提示"don‘t have both flex and bison;reverting to lex/yacc"错误;

4.安装 libpcap

  下载地址:http://www.tcpdump.org/

  下载版本:wget -c http://www.tcpdump.org/release/libpcap-1.5.3.tar.gz

   解压软件包:tar zxf libpcap-1.0.0.tar.gz

  进入解压后的目录,输入命令行:

   命令如下:

   ./configure

   make

   make install

经测试,经测试,只需要执行2、4步骤就行了

编译过成功后,执行iftop还是那个报错,还需要做如下设置

echo '/usr/local/lib' >> /etc/ld.so.conf     

ldconfig                                     

再次执行就成功了。

分享到:
关键词:Linux运维

网友留言(0 条)

发表评论