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

Compiling software from source code on Linux is often described in online guides with the traditional three-step formula: ./configure && make && sudo make install. However, downloading an open-source GitHub repository, extracting the tarball, typing ./configure, and being met with the immediate error: ‘bash: ./configure: No such file or directory’ halts compilation before it begins. This error does not indicate that your Linux shell is broken; rather, it indicates that the project does not use a pre-generated Autotools configure script or utilizes a modern build system like CMake, Meson, or Ninja. Knowing how to inspect project files and generate build recipes resolves this instantly.

Why Is ./configure Missing?

The ./configure script is an automated shell script generated by GNU Autotools to check for system libraries and compiler dependencies. It is missing because:

  • Unbuilt Autotools Git Repository: Developers who publish source code directly to GitHub often omit the generated configure script from Git to keep repositories lightweight, providing an autogen.sh or bootstrap script instead.
  • Modern Build Systems (CMake / Meson): The project uses modern cross-platform build systems that rely on CMakeLists.txt or meson.build rather than legacy Autotools.
  • Language-Specific Build Systems: Projects written in Rust (Cargo.toml), Go (go.mod), or Python (pyproject.toml) that do not use standard C makefiles.
  • Missing Execute Permissions: The configure file exists in the directory but lacks execution (+x) permissions, causing bash to fail execution.
  • Wrong Working Directory: Running the command from the parent folder rather than entering the extracted source directory.

Step 1: Inspect the Project Directory Structure

The first step is listing the exact files in the project folder to identify which build system the software uses.

  1. In your terminal, navigate to your extracted project directory:
    cd /path/to/extracted-source/
  2. List all files, including hidden files:
    ls -la
  3. Look for key build configuration files:
    • If you see autogen.sh or bootstrap.sh, proceed to Step 2.
    • If you see configure.ac or configure.in, proceed to Step 3.
    • If you see CMakeLists.txt, proceed to Step 4.
    • If you see meson.build, proceed to Step 5.

Step 2: Generate the configure Script Using autogen.sh

In many cloned Git repositories, running the bootstrap script invokes GNU Autotools to build the configure file for your specific environment.

  1. Ensure you have the required Autotools packages installed:
    # On Ubuntu/Debian:
    sudo apt update && sudo apt install -y autoconf automake libtool build-essential
    
    # On Fedora/RHEL:
    sudo dnf install -y autoconf automake libtool make gcc
  2. Grant execute permissions to the generation script and run it:
    chmod +x autogen.sh
    ./autogen.sh
  3. The script will execute aclocal, autoheader, and automake to produce a valid configure file.
  4. Once complete, run your standard compilation commands:
    ./configure
    make
    sudo make install

Step 3: Generate configure via autoreconf

If the repository contains configure.ac but no autogen.sh, use the universal autoreconf utility.

  1. Execute autoreconf with install and force flags:
    autoreconf -i -f
  2. The utility will inspect configure.ac and create the missing configure script along with supporting makefile templates.
  3. Run ls -l configure to verify the script was created, then proceed with ./configure.

Step 4: Build Projects Using CMake

If the directory contains a file named CMakeLists.txt, the software compiles using the modern CMake build system.

  1. Install CMake:
    sudo apt install -y cmake build-essential
  2. Create an isolated build directory to keep source code clean:
    mkdir build && cd build
  3. Configure and compile the project:
    cmake ..
    make -j$(nproc)
    sudo make install

Step 5: Build Projects Using Meson and Ninja

If the directory contains meson.build, use the high-performance Meson build engine.

  1. Install Meson and Ninja:
    sudo apt install -y meson ninja-build
  2. Set up the build directory:
    meson setup build
  3. Compile and install:
    ninja -C build
    sudo ninja -C build install

Identifying the correct build system and generating necessary configure scripts ensures that open-source software compiles cleanly on any Linux system.

Get the best tech tips delivered straight to your inbox.

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