How to Fix ‘bash: ./configure: No such file or directory’ in Linux

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.sh or autoreconf.
  • Modern Alternative Build Systems: The project utilizes modern build orchestration tools such as CMake, Meson/Ninja, or language-specific package managers (such as cargo for Rust or go build for 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, or npm rather 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.

  1. Run pwd in your terminal to ensure you are inside the extracted source directory.
  2. List directory contents to see available build manifests:
    ls -la
  3. Examine the project documentation:
    cat README.md | grep -i build -A 10
    (or inspect INSTALL, BUILD.md, or CONTRIBUTING.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.

  1. Install the required GNU Autotools packages on Ubuntu/Debian:
    sudo apt update && sudo apt install -y autoconf automake libtool build-essential
  2. On Fedora/RHEL, run:
    sudo dnf install autoconf automake libtool make gcc
  3. If an autogen.sh script exists, make it executable and run it:
    chmod +x autogen.sh
    ./autogen.sh
  4. If no autogen script exists but configure.ac or configure.in is present, generate the configure script manually:
    autoreconf -i
  5. Once complete, run ls -l configure to 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.

  1. Install CMake:
    sudo apt install -y cmake
  2. 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.

  1. Install Meson and Ninja:
    sudo apt install -y meson ninja-build
  2. 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.

  1. Verify permissions:
    ls -l configure
  2. If the execute flag (x) is absent, grant permission:
    chmod +x configure
  3. Run the configuration script:
    ./configure

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.