How to Fix the “ifconfig: command not found” Error in Linux
If you have encountered the “ifconfig: command not found” error in Linux, this means that the command-line utility that is responsible for displaying and configuring network interfaces is not installed or not in your system’s path. This can be a frustrating issue, especially if you need to configure your network settings quickly. However, the good news is that the solution to this problem is simple, and we’re going to explain how to fix it in this article.
Here are the steps you can follow to fix the “ifconfig: command not found” error in Linux:
Step 1: Check if the ifconfig command is installed
The first step is to check if the ifconfig command is installed in your system or not. Open your terminal and type the following command:
$ ifconfig
If the command returns an error message stating that the command is not found, then the ifconfig command is not installed on your system.
Step 2: Install the net-tools package
The ifconfig command is part of the net-tools package, so you need to install it to use the command. Depending on your Linux distribution, you can use the following command to install the net-tools package:
For Debian, Ubuntu and Linux Mint:
$ sudo apt-get install net-tools
For Fedora and CentOS:
$ sudo yum install net-tools
Step 3: Verify the installation
Once the net-tools package is installed, verify the installation by running the ifconfig command again. This time it should work without any errors.
That’s it! You have successfully fixed the “ifconfig: command not found” error in Linux by installing the net-tools package.