Fix Ubuntu's 'make' Error in Minutes

Fix Ubuntu's 'make' Error in Minutes

Learn how to fix the common error message make: command not found on Ubuntu, which can occur even for non-coders Discover the importance of the make utility and how to install it using apt, as well as troubleshooting steps if bash still can't find it Make it work on your Ubuntu system

If you encounter the "make: command not found" error on Ubuntu Linux, simply install make by running the command "sudo apt install make" or "sudo apt install build-essential" to install the standard development tools alongside make. The make utility is not included by default in standard Ubuntu installations and is commonly used by software developers.

How to Fix “make: command not found” on Ubuntu

To fix “make: command not found” on Ubuntu, you will need to install the make utility.

To install just the make utility, run the following command in a Terminal:

sudo apt install make

Fix Ubuntu's 'make' Error in Minutes


To avoid encountering the "make: command not found" error when building software, it is highly recommended to install the build-essential package. This package includes not only make, but also other critical packages necessary for software development. Simply run the following command in your terminal to install it:

sudo apt install build-essential

Fix Ubuntu's 'make' Error in Minutes


Once make is installed, you can effortlessly run a make command directly from the command line or launch an installation script that requires make without any issues.

What Is the make Utility?

The make tool is an essential command-line utility for software project building. As programmers write code, they need to convert it into an executable binary through a process called compilation, which requires a compiler program. Compilers are complex with many command-line options that can be invoked for each source code file, and managing hundreds of files can be challenging. A makefile is a simple text file that contains all the settings and rules necessary to build a project into an executable binary while avoiding the recompiling of unchanged files. By coordinating the building of the project, the make program enables controlled recompilation and building with just one command. Some integrated development environments automatically generate makefiles and use make to perform the compile phase in the background.

Make: What It Is and Why You Might Need It

Even if you're not a programmer, there are still situations where having make installed on your computer could be beneficial. Some software packages are not available in installation files, and instead require you to download an archive file of the source code or clone the program's Git repository in order to obtain it. In these cases, make is necessary to build and install the software.

If you use VirtualBox to run Linux distributions as virtual machines, you'll need to install the VirtualBox Guest Additions to ensure the best experience. This requires building the VirtualBox Guest Additions kernel modules, which can only be done with make present on the guest operating system.

How to Install make With apt

If you’re working with a new installation of Ubuntu, it won’t have make on it. If you’re administering a computer for someone else, it’s worth checking to see whether make is already installed.

Type the make command and hit “Enter.”

make

Fix Ubuntu's 'make' Error in Minutes


If you receive an error message from make stating that a specific command was not given and it failed to locate a makefile, it indicates that make is already installed and operational. To check the location of the make binary and its man pages, simply enter the whereis command in the terminal.

To verify if make is not installed, check if Bash produces an error message when attempting to access the make command.

Fix Ubuntu's 'make' Error in Minutes

In any case, make sure to keep track of the placeholder(s) included in the output:

Fix Ubuntu's 'make' Error in Minutes

Fix Ubuntu's 'make' Error in Minutes


If you haven’t applied any updates for a while, it’ll be worth running the apt command with the update option, first.

sudo apt update

Fix Ubuntu's 'make' Error in Minutes


We can install make easily with this command.

sudo apt install make

To make the most of make, it's essential to have the default set of development tools. Fortunately, these tools come bundled in a convenient package called "build-essential." This package not only includes make, but also tools like gcc and g++. To save time, I recommend skipping the step of installing make separately and going straight to installing "build-essential." This way, you can kill two birds with one stone. To install the package, simply use the command: sudo apt install build-essential.

Fix Ubuntu's 'make' Error in Minutes


Installing build-essential may take a few minutes due to the numerous tools included. However, the wait is worth it as these tools are essential for various software builds and will prove useful in the long run.

If there are instances where Bash cannot locate make even after its installation, there is a simple solution. Try reinstalling make using the following command:

sudo apt install --reinstall make

Fix Ubuntu's 'make' Error in Minutes

What If Bash Still Can’t Find make?

If you're still having trouble, try using the find command to locate the make binary. By searching your file system from the root directory for a file called "make," you can ensure it's in a directory that's included in the $PATH environment variable. To do this, simply enter the following command and pipe the output into less:

find / -type f -name "make" | less

Fix Ubuntu's 'make' Error in Minutes

Fix Ubuntu's 'make' Error in Minutes


Using the find command, locate all lines containing the word "make" by pressing forward slash "/" in less, typing "make," and pressing "Enter." This will display all lines with the word "make."

After completing the search, it becomes apparent that there are three files that Bash utilizes as part of its "Tab" command-line completions, and the binary executable. However, there seems to be an issue with this installation since the make binary is in the incorrect directory, specifically the "/etc/" directory.

To fix this problem, we must move the make binary to the correct location, which is "/usr/bin." Once this is done, the make function should work properly. To do this, enter the following command:

sudo mv /etc/make /usr/bin

Remember the output MUST ALWAYS KEEP/INCLUDE placeholder(s) :

Fix Ubuntu's 'make' Error in Minutes


Fix Ubuntu's 'make' Error in Minutes

Now if we try to use the make command, any messages we get should come from make, and not from Bash.

make

Fix Ubuntu's 'make' Error in Minutes


Great, we’ve got make working on this computer. You will no longer see the “make: command not found” error.

You have the power to succeed anywhere.

These methods can be applied to other distributions as well. Simply replace the installation commands with those used in your particular distribution.

To install the build tools, along with make, on Fedora, use the following command:

sudo dnf groupinstall "Development Tools" "Development Libraries"