Solution to Ubuntu libpcap Installation Problems

Source: Internet
Author: User

The libpcap library is successfully installed only when the pcap. h file cannot be found during libpcap library programming in Ubuntu 11.10. However, tcpdump is successfully installed. "tcpdump indicates that the user name is resolved to the BPF command by The libpcap database. Isn't tcpdump saved? After a while, Google found a blog post about spring water flowing to the east and solved the problem. The link is as follows:

Http://www.cnblogs.com/lynch_world/archive/2011/08/31/2160678.html

-------------------------------------- The following content is reprinted --------------------------------------------------

The environment is ubuntu10.1020.libpcap-1.1.1.tar.gz.

1. Download libpcap

The official website of libpcap is

2. Decompress

Tar zxvf libpcap-1.1.1.tar.gz

3. Configuration

Switch to the near libpcap unzipping directory libpcap-1.1.1 and use the configure configuration command to generate the MAKEFILE file.

./Configure

In this step, the flex package may be missing:

?
configure: error: Your operatingsystem'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 .

Solution:

?
sudo apt-get install flex

  

4. Compile

Make

YACC errors may occur:

?
yacc -d ./parse.y<br>make: yacc: Command not found<br>make: *** [parse.c] Error 127

Solution:

 

?
sudo apt-get install -y byacc

5. Installation

Sudo make install

Note: you must add sudo. Otherwise, permission issues may occur.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.