Following update of my Kubuntu, I'm not able to monitor my network consumption using nethogs:

sudo nethogs enp1s0
creating socket failed while establishing local IP - are you root?

Kernel

$ uname -a
Linux xyz 4.2.0-27-generic #32-Ubuntu SMP Fri Jan 22 04:49:08 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Release

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 15.10
Release:        15.10
Codename:       wily

Version

$ nethogs -V
version 0.8.0
  • it even crashes here..., the github one seems good tho – Aquarius Power Feb 11 '16 at 1:21
up vote 92 down vote accepted

This is solved by version 0.8.1.

As it's not available in repo nor PPA you need to build it (it is really easy and quickly done).

Fetch and extract the most recent version (as of August 2016, v0.8.5)

wget -c https://github.com/raboof/nethogs/archive/v0.8.5.tar.gz
tar xf v0.8.5.tar.gz 
cd ./nethogs-0.8.5/

Install dependencies and build

sudo apt-get install libncurses5-dev libpcap-dev
make && sudo make install 

Check and run

nethogs -V
sudo nethogs
  • 9
    Better with checkinstall that we can manage it easily, also avoiding conflict with the default repo from ubuntu. Just check license and version to update this command: make && sudo -k checkinstall --pkgsource="https://github.com/raboof/nethogs/" --pkglicense="GPL2" --deldesc=no --nodoc --maintainer="$USER\\<$USER@$HOSTNAME\\>" --pkgarch=$(dpkg --print-architecture) --pkgversion="0.8.2" --pkgrelease="SNAPSHOT" --pkgname=nethogs make install. – Aquarius Power Feb 11 '16 at 2:17
  • 3
    @ÉdouardLopez checkinstall will call make install and track everything it does to create a deb package :) – Aquarius Power Feb 13 '16 at 0:29
  • 2
    You can use checkinstall if you want it to update when the next versions roll in – GuySoft Apr 2 '16 at 10:35
  • 1
    @TylerCollier the $PATH variable was probably updated and need to be reexported so you can access correct version. You can install the synaptic package and check where it is installed with which nethogs, then reinstall from source and check again to see if the path changes. – Édouard Lopez Apr 4 '16 at 8:20
  • 2
    I can confirm the command from @AquariusPower works in gNewSense 4 Ucclia (upgraded into Debian Jessie) perfectly. I am using NetHogs 0.8.1 now. My binary of nethogs here belongs to /usr/local/sbin/nethogs. Thank you. – Ade Malsasa Akbar Jun 5 '16 at 6:37

You can also build from latest source code in the git repository. You still need to install the dependency packages first. After building you can run nethogs from your current directory:

sudo apt-get install libncurses5-dev libpcap-dev
git clone --depth 1 https://github.com/raboof/nethogs.git
cd nethogs
make
sudo ./src/nethogs

You can also find the instructions on the Nethogs project page.

  • 6
    Please do not just dump a bunch of commands here but also explain what they do and why you think they solve the problem. Thanks. – Byte Commander Mar 24 '16 at 8:22
  • 3
    I think is self explanatory, 1 - install the software dependencies, 2 - download the latest source from Git, 3 - goes to the newly created directory, 4 - compiles the program, 5 - runs the program – D.Snap Mar 25 '16 at 2:34
  • 2
    I've added the requested explanation in the answer and a link to the official instructions. – Stephan Henningsen Mar 31 '16 at 8:41
  • 2
    Not everybody has git nor want's to install it. Dowloading the tar and building is good enough. – erm3nda Apr 12 '16 at 23:58
  • 2
    the current repo compiles the executable into the src/ subdirectory, so the last command needs to be sudo src/nethogs – drevicko May 3 '16 at 21:52

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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