Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Facebook Twitter Instagram
Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Tech News Today
Home»Linux»How To Fix “ifconfig Command Not Found” Error?

How To Fix “ifconfig Command Not Found” Error?

Anup ThapaBy Anup ThapaDecember 18, 2022
ifconfig command not found

The ifconfig utility stopped being actively maintained and developed for Linux over a decade ago; its replacement being the ip command.

As a deprecated utility, it’s not included by default on Linux distros these days. This is the main reason for the ifconfig command not found error as the package isn’t installed to start with.

Additionally, non-root users don’t have the /sbin and /usr/sbin paths in their PATH variable, which also leads to this error.

In this article, we’ve concisely explained how you can resolve this error in both scenarios and introduced the ip command for those interested in switching.

Table of Contents

  • How to Fix ifconfig Command Not Found
    • Install ifconfig
    • Resolve PATH Issues
    • Switch To ip

How to Fix ifconfig Command Not Found

Since ifconfig isn’t present to start with in most cases, we recommend that as a good place to start troubleshooting. 

Install ifconfig

Ifconfig is installed as part of the net-tools package, a collection of networking utilities, some of which you may have heard of or used like arp, netstat, and route.

  • On Debian-based distros, you can install net-tools with:
    sudo apt install net-tools
    sudo apt install net tools
  • On RedHat-based distros, you can use:
    sudo dnf install net-tools
  • On Arch-based distros, you can instead use:
    sudo pacman -S net-tools

Resolve PATH Issues

Ifconfig is located in /sbin and /usr/sbin. Most distros won’t include these directories in the PATH variable unless you’re root. Due to this, the ifconfig command doesn’t get recognized, which leads to the ifconfig command not found error.

You can confirm this by checking whether the ifconfig binary exists in said directories or not with the following commands:
[ -e /sbin/ifconfig ] && echo “File exists.” || echo “File doesn’t exist.”
[ -e /usr/sbin/ifconfig ] && echo “File exists.” || echo “File doesn’t exist.”

check if ifconfig binary

Assuming the binary exists and the issue is with PATH, there are 3 ways to resolve the issue. First, you could add said directories to the PATH variable as such:
export PATH="/sbin:/usr/sbin:${PATH}"

Or, you could simply run the command with the full path as:
/usr/sbin/ifconfig

Or, the simplest method would be to just use sudo ifconfig.

For Kali users specifically, it’s worth mentioning that Kali’s default user used to be sudo prior to 2020, but this was changed for security concerns. Now, the default user is lower privileged. So, in case you were wondering why ifconfig worked without sudo before, but it’s required now, this is the reason. 

Switch To ip

As stated, ifconfig is deprecated now, and it’s been superseded by the ip command, which is part of the iproute2 collection of utilities. The solutions we’ve detailed above will resolve the ifconfig command not working error, but honestly, the better move may be to simply upgrade to using ip.

The equivalent of ifconfig is ip addr show, or simply ip addr, which can be further abbreviated as ip a. Some basic options include -s for stats, -h for human readable values, -d for details, and -c to configure color output.

ip addr s h d c
fix
Anup Thapa
  • LinkedIn

Anup Thapa is a tech writer at TechNewsToday. He mostly writes informative articles, tutorials, and troubleshooting guides related to Windows systems, networking, and computer hardware. Anup has been writing professionally for almost 5 years, and tinkering with PCs for much longer. His love for all things tech started when he got his first PC over 15 years ago. It was a Pentium IV system running Windows XP on a single 256 MB stick. He spent his formative years glued to this PC, troubleshooting any hardware or software problems he encountered by himself. Professionally, Anup has had brief forays into a variety of fields like coding, hardware installation, writing, etc. In doing so, he's worked with people of different backgrounds and skill levels, from average joes to industry leaders and experts. This has given him not just a versatile skillset, but also a unique perspective for writing that enables him to concisely communicate complex information and solve his reader's problems efficiently. You can contact him at anup@technewstoday.com

Related Posts

how to change boot order on linux

How to Change Boot Order on Linux

December 16, 2022
make-command-not-found

How to Fix “Make: Command Not Found” Error

September 20, 2022
linux terminal for windows

How to Install Linux Terminal on Windows

September 19, 2022
How-to-force-Quit-an-app-on-Linux

How to Force Quit an App on Linux

August 30, 2022
best linux for virtualbox

8 Best Linux Distros to Try in VirtualBox

August 30, 2022
format usb linux

How To Format USB In Linux (5 Easy Ways)

August 22, 2022
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
how long does a cmos battery last

How Long Does a CMOS Battery Last

January 25, 2023
thunderbolt vs usb c

Thunderbolt Vs USB C: What’s the Difference

January 25, 2023
how to find hidden folder in laptop

How to Find Hidden Folder in Laptop

January 24, 2023
You may also like
how-to-connect-headphones-to-tv

5 Ways to Connect Headphones to TV

January 29, 2023
connect-airpods-to-samsung-tv

How to Connect AirPods to Samsung TV? (Step-by-Step Guide)

January 29, 2023
AIO Pump Not Working

AIO Pump Not Working? Here’s How to Fix It

January 29, 2023
Recommended
Cookie Clicker Garden Guide

Cookie Clicker Garden Guide to Unlocking Every Seed

September 26, 2021
monitor no signal

Computer Turns On But Monitor Says No Signal (9 Ways To Fix)

November 10, 2022
Facebook Twitter Pinterest
  • Home
  • About Us
  • Our Team
  • Editorial Guidelines
  • Privacy Policy
  • Affiliate Disclosure
© 2023 TechNewsToday.

Type above and press Enter to search. Press Esc to cancel.