The netstat command is a very useful tool used by Linux system administrators. It helps find important information about the network configuration, which process is bound to a specific port, and more. In recent years some distros have been replacing netstat with the ss command. However, if you are like me and are used to netstat, you may want to install it. In this Linux quick tip we will show you how to install netstat on your favorite flavor of Linux.
The net-tools package provides the netstat command. Read below to learn how to install the netstat command on your system.
Install Netstat on Red Hat 7 or CentOS 7
Red Hat and similar distros use YUM package manager. Issue the following command to install the net-tools package and get access to the netstat command.
sudo yum install net-tools
Install Netstat on Red Hat 8 or CentOS 8
Red Hat 8 and similar distros switched to DNF for the package manager. Although it is backward compatible with YUM, you should still start using DNF. Here is how to install it with DNF.
sudo dnf install net-tools
Install Netstat on Debian or Ubuntu
In Ubuntu/Debian based systems you need to use the APT package manager. Preferably you should update your repositories before installing new software. Here are the commands you need to update your repos and install the net-tools package.
sudo apt update; sudo apt install net-tools
Install Netstat on Arch Linux
You guessed it, Arch uses a completely different package manager called pacman. Here we will us pacman with the
-S (sync) option to synchronize the packages and install netstat.
sudo pacman -S netstat-nat
Install Netstat on OpenSuse
Yep, Opensuse uses yet another package manager called zypper. This is basically the same command, just using a different package manager.
sudo zypper install net-tools
That's it, you should now be comfortable installing the netstat utility on your Linux system.
Netstat Resources and Links
This site uses Akismet to reduce spam. Learn how your comment data is processed.
Unfortunately this does not work any more for Suse 15. Now you have to install using
sudo zypper install net-tools-deprecated
Join Our Newsletter
- Bash Scripting (17)
- Basic Commands (50)
- Featured (7)
- Just for Fun (5)
- Linux Quick Tips (98)
- Linux Tutorials (60)
- Miscellaneous (15)
- Network Tools (6)
- Reviews (2)
- Security (32)
Leave a Reply