Solve Kali Linux error – bash: ifconfig: command not found

Kali Linux is one of the most popular distros to learn and perform ethical hacking and penetration testing tasks. However, if you have recently installed Kali on your computer or Virtual Machine then you definitely want to see your IP address of the computer via command-line tool. However, as you use the command ifconfig you may see an error “bash: ifconfig: command not found“. So, to solve this generally, we start installing net-tools but that will also give an error “Unable to locate package net-tools“. Henceforth, what to do now? Don’t worry, go through the steps given in this tutorial and you will be good to go.

bash ifconfig- command not found-min

Step 1: Switch to Apt directory of Kali Linux

On the Command terminal type;

cd /etc/apt/

Step 2: Edit Sources.list

Now, what we have to do is to access and edit the sources.list file of Kali Linux where it saved its all system or official repositories. Use the nano command:

sudo nano sources.list

Step 3: Add official Kali repository

Copy-paste the below given official repositories. First one is the standard one while the second if you want to install source packages. However, only the first one will be enough.

deb http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib

After adding use CTRL+X, type Y and hit the Enter button.

Add official Kali repository-min

Step 4: Run system update command

To reflect the changes in the system and flush cache run the update command:

sudo apt update

Step 5: Install net-tools on Kali

Use the below command to get the network tools on your Linux, so that later we can use the ifconfig command.

sudo apt install net-tools

Install net tools on kali Linux-min

Step 6: Use ifconfig command to check Ip address on Kali Linux

Finally, you can check the Ip address without any error:

ifconfig

check ipaddress on Kali Linux-min

Comments (5)

  1. tony.borlini December 8, 2019
  2. unknown brain March 7, 2020
  3. Qaiser March 12, 2020
    • IndianDude April 1, 2020
  4. md shorif April 16, 2020

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.