hostfiles command not found

In this troubleshooting guide we learn how to fix hostfiles command not found error message

Introduction

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

hostfiles: command not found

or when using sudo you get the following error message

sudo: hostfiles: command not found

Solutions to hostfiles: command not found

How To Fix hostfiles: command not found in Ubuntu / Debian / Kali Linux / Raspbian

In Ubuntu hostfiles is provided by hostfiles package.

hostfiles is:

hostfiles is a command-line tool which will read the hostfile fragments specified to be enabled from /etc/hostfiles/<fragment_name> and add them to /etc/hosts.

It will remove any fragments from /etc/hosts that are specified to be disabled.

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

sudo apt-get -y install hostfiles

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

You can also use apt command to install hostfiles.

sudo apt -y install hostfiles

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

sudo aptitude install hostfiles

Summary

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