ifconfig command not found

Call me old fashioned, but I still prefer using ifconfig command. It’s not as cool as the ip command found in recent Linux distros, but familiar and universal enough to be found pretty much everywhere else. This post shows how to install packages to make ifconfig working again.

/sbin/ifconfig: no such file or directory

Yep, that’s the error message I’m seeing on most recent distros. This simply means that ifconfig is no longer a core functionality installed with a base OS. You can still get it by installing net-tools package in your environment.

Here’s how my attempt looked on Debian 9 (Stretch) VM just a few minutes ago:

[email protected]:~$ ifconfig -a
-su: /sbin/ifconfig: No such file or directory

Install net-tools package for ifconfig and more

Simple enough step (I just know and remember that ifconfig is in net-tools package):

You need to have superuser powers, and by default Debian 9 doesn’t have sudo installed – so I’m just using su command to become root:

[email protected]:~$ su -

And now we install the net-tools package:

[email protected]:~# apt install net-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 154 not upgraded.
Need to get 248 kB of archives.
After this operation, 963 kB of additional disk space will be used.
Get:1 http://ftp.ie.debian.org/debian stretch/main amd64 net-tools amd64 1.60+git20161116.90da8a0-1 [248 kB]
Fetched 248 kB in 0s (601 kB/s)
Selecting previously unselected package net-tools.
(Reading database ... 128276 files and directories currently installed.)
Preparing to unpack .../net-tools_1.60+git20161116.90da8a0-1_amd64.deb ...
Unpacking net-tools (1.60+git20161116.90da8a0-1) ...
Processing triggers for man-db ( ...
Setting up net-tools (1.60+git20161116.90da8a0-1) ...

That’s it, ifconfig should start working right away:

[email protected]:~# ifconfig -a
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.X.Y netmask broadcast
inet6 fe80::a00:27ff:febe:8a41 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:be:8a:41 txqueuelen 1000 (Ethernet)
RX packets 94337 bytes 138887593 (132.4 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 31380 bytes 2338487 (2.2 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet netmask
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1 (Local Loopback)
RX packets 1154 bytes 292002 (285.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1154 bytes 292002 (285.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

See Also

Keep Learning with Me

Follow me on Facebook and Twitter or jump into Telegram chat!:
I'm using Brave browser
Give it a try, it's awesome: Brave Browser
IT Consultancy
I'm a principal consultant with Tech Stack Solutions. I help with cloud architectrure, AWS deployments and automated management of Unix/Linux infrastructure. Get in touch!

Recent Tweets