How to Solve Make Command Not Found Error in Linux Bash
-
Understanding the
make
Command - Installing Make on Ubuntu/Debian
- Installing Make on CentOS/RHEL
- Adding Make to Your PATH
- Conclusion
- FAQ

When you’re working in Linux, you might encounter the frustrating “make command not found” error while trying to compile software from source. This error can halt your progress, especially if you’re eager to build and run your application. The make
utility is essential for managing build processes, and without it, you might feel stuck. Fortunately, resolving this issue is usually straightforward.
In this article, we’ll walk you through effective methods to fix the “make command not found” error in Linux Bash, ensuring you can get back to your coding tasks without unnecessary delays.
Understanding the make
Command
Before diving into solutions, it’s important to understand what the make
command does. The make
utility automates the process of building and managing dependencies in software projects. It reads a file called Makefile
, which contains rules and instructions for compiling code. When you encounter the “command not found” error, it usually means that make
is not installed on your system or it’s not in your PATH.
Installing Make on Ubuntu/Debian
If you’re using a Debian-based distribution like Ubuntu, installing the make
command is quite simple. You can use the package manager apt
to install it. Here’s how:
sudo apt update
sudo apt install build-essential
Output:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
gcc g++ libc6-dev make
The following NEW packages will be installed:
build-essential
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,528 kB of archives.
After this operation, 9,904 kB of additional disk space will be used.
This command updates your package list and installs the build-essential
package, which includes make
along with other essential tools like gcc
and g++
. After installation, you can verify whether make
is successfully installed by typing:
make --version
Output:
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
This output indicates that make
is now installed and ready for use. If you see the version number, you’ve successfully resolved the error.
Installing Make on CentOS/RHEL
For users on CentOS or Red Hat Enterprise Linux (RHEL), the process is slightly different. You’ll use the yum
package manager to install make
. Here’s how you can do it:
sudo yum groupinstall "Development Tools"
Output:
Dependencies Resolved
================================================================================
Package Arch Version Repository Size
Installing:
make x86_64 1:4.2.1-10.el7 base 1.1 M
...
This command installs a group of development tools, including make
, gcc
, and other necessary utilities. After the installation is complete, you can confirm that make
is installed by running:
make --version
Output:
GNU Make 4.2.1
Built for x86_64-redhat-linux-gnu
Seeing the version number means you’ve successfully installed make
, allowing you to compile your projects without issues.
Adding Make to Your PATH
Sometimes, the make
command might be installed, but your system cannot find it due to PATH issues. To check if make
is installed but not in your PATH, you can use the which
command:
which make
Output:
/usr/bin/make
If the output shows a path, make
is installed. If it returns nothing, you may need to add its directory to your PATH. Here’s how you can do that:
- Open your
.bashrc
or.bash_profile
file in a text editor:
nano ~/.bashrc
- Add the following line at the end of the file:
export PATH=$PATH:/usr/bin
- Save the file and exit the editor.
- Reload the configuration:
source ~/.bashrc
Output:
(no output)
After reloading, you can verify if the make
command is now recognized by typing:
make --version
Output:
GNU Make 4.2.1
Built for x86_64-pc-linux-gnu
If you see the version number, you have successfully added make
to your PATH.
Conclusion
Encountering the “make command not found” error in Linux Bash can be a stumbling block for developers. However, with the right knowledge and commands, you can quickly resolve this issue. Whether you’re installing make
through a package manager or adjusting your PATH, these solutions will get you back on track. Remember, having the right tools at your disposal is essential for a smooth development experience.
FAQ
-
What is the make command used for?
Themake
command is used to automate the process of building and managing dependencies in software projects. -
Why does the make command not found error occur?
This error occurs when themake
utility is not installed on your system or is not included in your system’s PATH. -
How can I check if make is installed on my system?
You can check ifmake
is installed by typingwhich make
ormake --version
in the terminal. -
Can I install make using a different package manager?
Yes, the installation command may vary based on your Linux distribution. For instance, useapt
for Debian-based systems andyum
for CentOS/RHEL. -
What should I do if I still see the error after installation?
If the error persists, ensure that the directory wheremake
is installed is included in your system’s PATH.
Yahya Irmak has experience in full stack technologies such as Java, Spring Boot, JavaScript, CSS, HTML.
LinkedIn