Compiling software from source code in Linux traditionally begins with the classic compilation triad: ./configure, make, and sudo make install. However, extracting a downloaded tarball archive or cloning a project repository from GitHub and immediately typing ./configure frequently fails with a terminal error: bash: ./configure: No such file or directory. This error indicates that the shell cannot locate an executable script named configure in your current working directory, halting the build process before dependency verification can begin.
Why Is ./configure Missing in Modern Linux Projects?
The traditional GNU Autotools configure script is not universal to all open-source projects. Encountering this error occurs due to one of several build workflow realities:
- Unbuilt Autotools Distribution: Source code cloned directly from Git repositories often omits generated configure scripts to avoid repository bloat; the script must be generated locally using
autogen.shorautoreconf. - Modern Alternative Build Systems: The project utilizes modern build orchestration tools such as CMake, Meson/Ninja, or language-specific package managers (such as
cargofor Rust orgo buildfor Go) rather than legacy Autotools. - Incorrect Current Working Directory: Running the command from the parent directory without navigating into the extracted source folder.
- Missing Executable Permissions on the Script: A configure script is present, but lacking execution permission flags (
chmod +x). - Python or Node.js Build Tooling: The application relies on
setup.py,pyproject.toml, ornpmrather than C/C++ compilation toolchains.
Step 1: Verify Directory Contents and Inspect Build Documentation
Before running build commands, check what files exist in the source root and review the developer’s build instructions.
- Run
pwdin your terminal to ensure you are inside the extracted source directory. - List directory contents to see available build manifests:
ls -la - Examine the project documentation:
(or inspectcat README.md | grep -i build -A 10INSTALL,BUILD.md, orCONTRIBUTING.md). The documentation will state the exact required build command sequence.
Step 2: Generate the Configure Script Using autogen.sh or autoreconf
If you cloned the source from GitHub and the repository contains configure.ac or autogen.sh, generate the missing configure binary.
- Install the required GNU Autotools packages on Ubuntu/Debian:
sudo apt update && sudo apt install -y autoconf automake libtool build-essential - On Fedora/RHEL, run:
sudo dnf install autoconf automake libtool make gcc - If an
autogen.shscript exists, make it executable and run it:chmod +x autogen.sh ./autogen.sh - If no autogen script exists but
configure.acorconfigure.inis present, generate the configure script manually:autoreconf -i - Once complete, run
ls -l configureto confirm that the script has been generated, then proceed with./configure.
Step 3: Building CMake-Based Projects
If the directory contains a file named CMakeLists.txt, the project utilizes CMake instead of configure.
- Install CMake:
sudo apt install -y cmake - Create a dedicated out-of-source build directory and compile:
mkdir build && cd build cmake .. make sudo make install
Step 4: Building Meson and Ninja Projects
If the directory contains a file named meson.build, use the Meson build pipeline.
- Install Meson and Ninja:
sudo apt install -y meson ninja-build - Configure and compile:
meson setup build ninja -C build sudo ninja -C build install
Step 5: Ensure the Script Has Executable Rights
If a configure file is physically present in the directory but returns an error when executed, grant execution privileges.
- Verify permissions:
ls -l configure - If the execute flag (
x) is absent, grant permission:chmod +x configure - Run the configuration script:
./configure