Attempting to compile open-source software, install custom hardware drivers, or build software from source code in Ubuntu often terminates with the shell notice: Command ‘make’ not found, but can be installed with: sudo apt install make. Without the GNU Make automation tool, running compilation commands like make, make install, or cmake --build fails before compiling source trees. This error is standard on fresh installations of Ubuntu Desktop and minimal server cloud images, where developer compilation tools and C/C++ compiler toolchains are excluded by default to conserve disk space and reduce the local security attack surface.
Resolving this compiler deficiency requires updating your local package lists, installing the complete build-essential meta-package, and verifying GCC and Make compiler toolchains.
Why Is the ‘make’ Command Missing in Ubuntu?
The GNU Make utility orchestrates code compilation according to instructions defined in a Makefile. In Ubuntu systems, the command is absent due to several standard deployment reasons:
- Minimal Default Installation: Canonical provides standard Ubuntu desktop and server images configured strictly for end-user execution rather than software compilation. Compilers are omitted out of the box.
- Cloud and Container Image Optimisation: Official Ubuntu cloud instances (AWS EC2, Google Cloud, Azure) and Docker base containers strip all development utilities to achieve sub-gigabyte image sizes.
- Single Utility vs Complete Toolchain Deficiency: Installing
makealone is usually insufficient, as building software from source immediately fails on the next line if the GNU C Compiler (gcc), C++ Compiler (g++), or libc development headers (libc6-dev) are absent. - Stale Local APT Package Lists: Running
apt installon a newly provisioned Ubuntu instance fails with package 404 errors untilapt updatesynchronises repository indexes.
Method 1: Install the Complete build-essential Meta-Package (Recommended)
Rather than installing make in isolation, the industry-standard best practice on Debian and Ubuntu distributions is installing the build-essential package. This meta-package installs GNU Make, GCC, G++, DPKG development tools, and foundational C libraries simultaneously:
- Open your terminal.
- Update your local package lists to ensure APT retrieves the latest repository definitions:
sudo apt update - Install the complete compiler suite:
sudo apt install -y build-essential - Allow the installation to complete. APT will download GNU Make along with GCC, G++, and necessary header files.
- Verify that GNU Make is installed and inspect its version:
make --versionThe terminal will output:
GNU Make [version] Built for x86_64-pc-linux-gnu. - Verify that the GCC compiler is also available:
gcc --version
Method 2: Install Only the Standalone GNU Make Utility
If you are operating inside a resource-constrained virtual environment or Docker container where you exclusively need Make to execute simple automation scripts without C/C++ compilers:
- Refresh local package indexes:
sudo apt update - Install only the make binary:
sudo apt install -y make - Confirm the binary path:
which makeThe command will confirm location at
/usr/bin/make.
Method 3: Troubleshooting ‘Package has no installation candidate’
If running sudo apt install build-essential or sudo apt install make fails with the error Package ‘make’ has no installation candidate or Unable to locate package build-essential:
- Your Ubuntu installation media has the main or universe software repositories disabled.
- Enable the standard Ubuntu repositories:
sudo add-apt-repository main sudo add-apt-repository universe sudo apt update - Re-run the installation command:
sudo apt install -y build-essential
Method 4: Verifying Compilation with a Sample Test
To verify that your newly installed Make environment functions properly:
- Create a temporary test Makefile:
cat << 'EOF' > Makefile all: @echo "Make compiler environment is fully operational!" EOF - Execute Make:
make - The terminal will print:
Make compiler environment is fully operational!, confirming that GNU Make is properly parsing rules and executing commands. Clean up the test file withrm Makefile.