network-test command not found

In this troubleshooting guide we learn how to fix network-test command not found error message

Introduction

When you run more command in linux terminal / console, you get the following error message

network-test: command not found

or when using sudo you get the following error message

sudo: network-test: command not found

Solutions to network-test: command not found

How To Fix network-test: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu network-test is provided by ifupdown-extra package.

ifupdown-extra is:

This package provides a set of network testing scripts to be used together with the ifupdown package. These scripts can:

  • check the network cable before an interface is configured.
  • test if an assigned IPv4 or IPv6 address is already in use in the network.
  • test if default network gateways are reachable.
  • setup default static routes for interfaces.

Additionally network static routes can also be defined globally for the system when this is needed (e.g. for ‘reject’ rules) and will be added after network initialisation.

This package also provides ’network-test’, a script to test the network configuration status by checking:

  • Status of available interface.
  • Availability of configured gateway routes.
  • If host resolution is working properly (DNS checks).
  • If network connectivity is working, including ICMP and web connections to remote web servers.

To fix this problem, we can install more using the command below.

sudo apt-get -y install ifupdown-extra

This command might take some time to finish depending on your machine internet connection.

You can also use apt command to install ifupdown-extra.

sudo apt -y install ifupdown-extra

Or if you have aptitude installed you can use the following command.

sudo aptitude install ifupdown-extra

Summary

In this tutorial we learn how to fix network-test command not found error in Ubuntu / Debian / Kali Linux or Raspbian distribution.