Debian

How to Fix the “ifconfig” Command not Found Error on Debian?

ifconfig command is used to display the network interface information in Linux-based systems; it is a system administration utility. “ifconfig” was widely used in all previous Linux distributions until it was declared deprecated by the developer’s community as the continuous maintenance of the utility was stopped and in the latest Linux distribution such as Debian using the ifconfig command generates an error.

If you are looking for ways to fix this ifconfig command error, then follow the article’s instructions.

Fix the “ifconfig” Command not Found Error on Debian?

If you are using ifconfig command on Debian and seeing the error as shown in the image below:

ifconfig

 

Then there are five ways to fix the “ifconfig” error on Debian, those include:

Method 1: Running as “sudo”

One of the easiest ways to solve the “ifconfig” error is by running it as sudo to use the root privilege. Just add sudo before the ifconfig command and it should work then:

sudo ifconfig

 

Method 2: Running the Full Path

Another way to use the ifconfig command is by using the full path of the ifconfig command. In Debian, all the commands are present at the location /sbin, so if the ifconfig command isn’t working directly then use the full path of this command as given below:

/sbin/ifconfig

 

Method 3: By Installing net-tools

Another method to permanently resolve the ifconfig command error is by installing net-tools which can be installed from the official repository. However, before installing net-tools, update the system by using the below-written command:

sudo apt update

 
Then install net-tools by running the below-mentioned apt command:

sudo apt install net-tools

 

After which you can run the ifconfig command.

Method 4: Using an Alternate Command

Sometimes due to system command path errors, the ifconfig command does not run even after trying all the above three methods, then in such case, you can go for an alternate command which is mentioned below:

ip a

 

This is an easy alternative to ifconfig as it is pre-installed in all the latest versions of Debian, also it does not require any configuration. So even if none of the above methods resolves your error this will surely work on your system.

Conclusion

The four different solutions to resolve the “ifconfig” error in Debian are discussed in the article. The easiest ways are to use the sudo ifconfig command or to run the ifconfig command with its path as /sbin/ifconfig. The other method includes installing net-tools. If no method works, you can use the alternative command ip a to get a similar output.

About the author

Zahra Zamir

An Electronics graduate who loves to learn and share the knowledge, my passion for my field has helped me grasp complex electronics concepts and now I am here to share them with others.