bash: netstat: command not found
This is a companion discussion topic for the original entry at https://linuxconfig.org/bash-netstat-command-not-found-debian-ubuntu-linux
bash: netstat: command not found
Kuba Nowacki
THANKS!
Augusto Santos
Thanks !!!
Gabriel RB
Thank you.
6/11/2019
This did not work on ubuntu 18 bionic beaver
i am getting a message saying net-tools is fully up to date with zero ability to run
apt install netstat
or any other variant
sudo apt-get etc.
package is not found
Hi Johnathon,
Welcome to our forums.
Utilities or commands VS the packages they are contained in can be indeed confusing at first. netstat
is the command you’d like to use, and net-tools
is the package that contains it. By installing the package, you gain access to the command. If your query says that the package is installed, you already have the netstat
command. You can test it with something like:
$ netstat --version
There is no individual package called ‘netstat’, that’s why you get an error with apt
.
Sandmann
I run into the same problem as Johnathon. Using
#netstat --version.
I confirm netstat doesn’t exist.
Then do
Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package net-tools
My OS is ubuntu 18.04
Hi Remoteblue,
Welcome to our forums.
It is strange that your system can’t locate the package, I have just tested it on an Ubuntu 18.04.3 machine, and it does see the package with the default repository configuration.
Do you have the main repository enabled?
You can find that by executing:
$ cat /etc/apt/sources.list | grep main | grep -v "#"
If you get lines from the above, please post them here.
It should be something like the following:
deb http://<ubuntu-repository-next-to-you>/ubuntu/ bionic main restricted
You may also want to try updating the apt cache by executing:
# apt-get update
Then trying the installation again.