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 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 . |
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.