Installing libpcap on Ubuntu

In Ubuntu, libpcap-0.8 is already installed by default. To install the gopacket library, though, you also need the header files in the development package. You can install the header files through the libpcap-dev package. We will also install git because it is needed to run the go get command later when installing gopacket:

sudo apt-get install git libpcap-dev

Get Security with Go now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.