Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

How can I install libpcap on Ubuntu 12.04?

When I use apt-get install libpcap I receive following message:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package libpcap
share|improve this question
    
What are you trying to do with libpcap? –  Braiam Sep 20 '13 at 17:27
1  
I get source code needs libpcap. It uses libpcap to capture network packets. –  SuB Sep 20 '13 at 18:25
add comment

3 Answers

up vote 7 down vote accepted

Use this:

sudo apt-get install libpcap-dev
share|improve this answer
    
That's because 1) libpcap-dev (probably) depends on the libpcap package, and will bring it in and 2) if you have source code that needs libpcap, you not only will need the libpcap package (whatever it's called - its name might be "libpcap0.8", for various Debian reasons), which provides shared libraries for already-built programs that use libpcap, but you will also need the libpcap-dev package, which provides header files needed to compile the source code for programs that use libpcap (and static libraries in case people want them). –  Guy Harris Sep 20 '13 at 18:34
add comment

To install libpcap open a terminal by pressing Ctrl+Alt+Tand type:

sudo apt-get install libpcap0.8 libpcap0.8-dev libpcap-dev
share|improve this answer
1  
According to Ubuntu Packages libpcap-dev depends on libpcap0.8-dev and itself depends on libpcap0.8. So libpcap0.8 is redundant. –  SuB Sep 20 '13 at 10:52
add comment

to install libpcap. try these commands

cd /usr
mkdir nembuild
cd nembuild    
wget http://www.tcpdump.org/release/libpcap-1.5.3.tar.gz
tar -xf libpcap-1.5.3.tar.gz
cd libpcap-1.5.3
./configure
make && make install

Enjoy!!!

share|improve this answer
    
Why install a package while there is a binary (RPM, DEB , ...) package for it? Your method is the most complex way dude! –  SuB Apr 20 at 4:52
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.