Fix the “make: command not found” Error in Ubuntu

The Linux make command is used for building and compiling applications from source code, as it also builds and compiles dependencies of the source code with the help of  a "makefile."

As a Linux user, you may compile utilities and install them from the command line using the make program. However, sometimes users get the error message "make: command not found." in return.

In this article, you will learn what causes this error and how you can solve it using different methods.

Cause of "make: command not found" Error

The make package is a basic Linux package that usually comes by default in most Linux distributions, but it is not always the case. When that happens, a user's attempt at compilation or building packages results in an error.

To resolve this error, you can install the make package and restore the system's building and compiling capabilities.

Prerequisites

  • Ubuntu or any other Linux-based distribution
  • Terminal access
  • A user account with sudo or root privileges.

Note: Although the commands used in this tutorial are specifically for the Ubuntu system, all the methods are also valid for any other Linux-based system.

Check for make in Your System

First of all, you need to check if you have the make command installed on your system or not. To do so, you need to run the following ls command to see the /usr/bin/make directory.

ls /usr/bin/make

Check if make command is installed

The output shows that the default directory of the make common command does not exist on your system. It means that the make is not present in your system. To further ensure this, run the following command.

/usr/bin/make --version

Check the version of the make command

The above output verifies that your system is missing the make package.

Install make Package

Update Your System

Update your system to make sure that your repositories are up to date.

sudo apt-get update

Update packages

Install the make Command

Once the system update is completed, run the following apt command to install the make package.

sudo apt-get install -y make

Install make command

Once make is installed, run the above list command or your initial command to see if the issue has been resolved.

Install the build-essential Package

If you still encounter some issues, you can then install the build-essential package. If you still encounter some issues, you can then install the build-essential package. build-essential is a meta-package, which means that it installs a list of other packages as dependencies. All of the necessary packages for package building and compilation are included in the build-essential package, so the make package comes by default with the build-essential package.

sudo apt install build-essential

Install Build Essentials

The make command not found error has been fixed now and you can continue compiling your application.

Leave a Comment