The make command is probably one of the most widely used commands in the Linux ecosystem. This command builds and compiles programs directly from the source code.

As a Linux user, you can use the make command to compile and install utilities from the terminal. But sometimes, the system throws the "make: command not found" error when users try to build a package using make.

By the end, you will understand how to fix the "make command not found" error on Ubuntu.

Fix the "make: command not found" Error

While make is one of the standard Linux packages and comes pre-installed on most Linux distros, sometimes it isn't available on a system. In such cases, the system throws the make not found error whenever you try to build a package using make.

You need to follow a few steps to ensure the make command is correctly installed and works on your computer:

1. Verify if make Is Installed on Ubuntu

The primary step is verifying whether make exists on your machine. Use the ls command to check the contents of the /usr/bin/make directory:

        ls /usr/bin/make
    

Further on, check if you can execute the command with its absolute path:

        /usr/bin/make --version
    

The aforementioned command will display the make version installed on your system. Ubuntu will display the make command not found error if it's not installed on your machine.

Linux Ubuntu terminal interface showing verification commands

2. Installing make With APT

To fix the make command not found error, you should start by updating your system with this one-liner:

        sudo apt update && sudo apt upgrade -y
    
Linux Ubuntu terminal interface showing update commands

Post system update, install the make command by running:

        sudo apt install -y make
    

Output:

Linux Ubuntu terminal interface with installation commands

If the aforementioned command doesn't work, download and install the build-essential package, as follows:

        sudo apt install build-essential
    

Output:

Linux Ubuntu terminal interface showing installation commands

build-essential consists of all the necessary packages required for building and compiling Linux packages from the source. The make command is a part of these packages.

What to Do if make Still Doesn’t Work?

If you followed the above steps and the make command is still not working, you can try one last step. Sometimes, the make command doesn't get added to the $PATH variable. To fix this issue, reinstall make with the --reinstall command.

        sudo apt install --reinstall make
    

If this still does not work, you must manually add the binary to your $PATH as a last step. In all entirety, the above steps should work and you should get past this "command not found" error with ease.

Troubleshooting Command Errors on Ubuntu

The make command is an essential compiler tool on Linux. The errors provided by the system are usually self-descriptive, and experienced users can figure out the solution by looking at the error statement.

In addition to local workstations, Linux-based servers also throw such errors. You can fix most issues by performing a basic audit on the server.