-bash: ../binutils-2.38/configure: Permission denied

Abstract: Resolve bash permission denied errors on configure scripts by applying executable permissions with chmod +x.

Created: 2026-09-15 by

The -bash: ../binutils-2.38/configure: Permission denied error occurs when the shell attempts to execute a script lacking executable permissions, typically during the GCC build process. This happens because Unix-like systems require explicit execution rights on files, even if they are readable scripts like configure. Resolving this involves verifying file ownership and applying the correct permission bits using standard command-line tools.

Understanding the Root Cause

When you compile software from source, such as building GCC or binutils, you often rely on autoconf-generated scripts. The configure script is a shell script that checks your system's capabilities before generating the Makefile. In Linux and macOS environments, a file must have the execute bit set for the user, group, or others to run it directly. If you downloaded the source code via a method that stripped executable flags (such as some archive extraction methods or network transfers), the system will refuse to run it, throwing the permission denied error. This issue is distinct from read-only filesystems. If the error were due to a read-only disk, you would typically see "Read-only file system" messages. Here, the specific mention of Permission denied combined with an attempt to run a binary or script points squarely at the mode bits of the file itself. It is also worth noting that while we focus on compilation here, similar permission issues can affect general bash scripting workflows, which are discussed in more detail regarding Bash performance and security configurations.

Step-by-Step Resolution

To fix this, you need to ensure the configure script has the executable attribute. Follow these steps carefully within your terminal session.

1. Navigate to the Source Directory

First, ensure you are in the correct directory where the source code was extracted. You should see the configure file listed when you run ls.
cd path/to/binutils-2.38
ls -l configure
Look at the output. A typical readable but non-executable file looks like this: -rw-r--r--. An executable file looks like -rwxr-xr-x. Notice the 'x' characters, which stand for execute.

2. Apply Executable Permissions

Use the chmod command to add the execute permission. The most common approach is to make the file executable for the owner, and optionally for the group and others.
chmod +x configure
Alternatively, if you want to be precise about who gets access:
chmod 755 configure
The number 755 means:
  • 7 (Owner): Read, Write, Execute
  • 5 (Group): Read, Execute
  • 5 (Others): Read, Execute
After running this, verify the change by running ls -l configure again. You should now see rwxr-xr-x.

3. Run the Configuration Script

Once permissions are corrected, you can proceed with the standard build command. It is crucial to prefix the command with ./ to tell the shell to look in the current directory for the executable.
./configure --prefix=/usr/local/gcc-build
If you omit ./, the shell searches your $PATH for a file named configure, which likely does not exist globally, leading to a "command not found" error instead. However, if you still get a permission error after adding ./, double-check that you are not trying to run it as a different user without proper sudo privileges.

Common Pitfalls and Advanced Checks

Sometimes, simply changing permissions isn't enough. If you encounter persistent errors, consider these additional factors.

Filesystem Mount Options

Check if your partition is mounted with the noexec flag. This is common on temporary directories like /tmp or external drives configured for security. Use the mount command to check mount options. If noexec is present, you cannot run scripts there regardless of file permissions. Move your source code to a local home directory or partition without this restriction.

NFS and Network File Systems

If you are compiling on a machine accessing files over NFS, ensure that the server exports the directory with exec permissions. Some older NFS versions default to denying execution for security reasons. Referencing guides on troubleshooting Cygwin permission errors can provide insight into how networked Windows-to-Linux file shares handle execution bits differently than native Linux partitions.

SELinux Contexts

On systems with SELinux enabled (common in RHEL, CentOS, and Fedora), file permissions might look correct, but the security context prevents execution. Check the context with ls -Z. If the context is incorrect, you may need to restore it using restorecon -vR . or manually label the file. This is a higher-level security constraint that overrides standard Unix permissions.

Verifying the Build Environment

After resolving the permission issue, it is good practice to clean any previous partial configuration attempts. Run make clean or remove the generated object files to ensure a fresh start. Then, proceed with make -j$(nproc) to utilize all available CPU cores for faster compilation. Always monitor the output of ./configure for any warnings about missing dependencies. While permission errors block execution entirely, missing libraries only cause failures later in the make stage. Ensuring your environment is fully prepared before running the configure script saves significant debugging time.

Frequently Asked Questions

Why do I get "Permission denied" even after chmod?

If chmod fails or doesn't work, check if the filesystem is mounted as read-only or with the noexec flag. Additionally, verify that you are the owner of the file; if it belongs to root, you must use sudo chmod to modify its permissions.

What is the difference between ./configure and configure?

Using ./configure tells the shell to execute the script located in the current directory. Using just configure makes the shell search the directories listed in your PATH environment variable, which usually does not include the current folder, resulting in a "command not found" error.

Can I run configure without making the file executable?

Yes, you can run it through the shell explicitly by typing sh ./configure or bash ./configure. This bypasses the need for the execute bit on the script itself because you are passing the file as an argument to an already-running executable shell.

How do I fix permission errors on NFS mounts?

You need to remount the NFS share with the exec option allowed, or move your source code to a local filesystem. Contact your system administrator if you do not have the privileges to change mount options, as this is a server-side configuration.

Does SELinux affect standard Unix permissions?

Yes, SELinux acts as an additional mandatory access control layer. Even if chmod allows execution, SELinux may deny it based on the file's security context. You can diagnose this by checking audit logs or using getenforce to see if SELinux is enforcing policies.

Latest News

How to Display Output of xterm Command in Terminal Screen using Cron

Resolve the inability to display xterm output in a terminal screen from cron by redirecting logs or using wall instead of insecure X11 workarounds.

Read More
Expose Local Server on VPS Preserving Real Client IPs (OS Level)

Resolve VPS logging showing only gateway IPs by configuring reverse proxies to forward real client addresses via X-Forwarded-For headers.

Read More
How to Clear Recent Files History in Linux without Deleting Actual Files?

Clear recent files history in Linux by deleting ~/.local/share/recently-used.xbel without removing the actual files.

Read More
Best HDD Copy Strategy: Manually Syncing and Rewriting Scratch

Resolve data drift between two 4TB hard drives by using rsync with the --delete flag to manually sync and rewrite scratch data for an exact mirror.

Read More
Understanding Bash Prompt Abbreviations: An Overview

Resolve repetitive typing errors by creating and persisting Bash aliases in the .bashrc file for improved command-line efficiency.

Read More
Free Tools and Methods to Log Real-Time Performance Details in Task Manager

Log real-time CPU and memory metrics to CSV files using Windows Performance Monitor Data Collector Sets to troubleshoot system slowness.

Read More
Contact Qatar Airways Customer Service: Phone Number, Help Center, and More

Resolve urgent Qatar Airways reservation issues like flight changes and baggage claims using the US phone number +1801-855-5905 or online self-service tools.

Read More
Windows 11: Alt Codes Displaying Wrong Characters - Solutions

Resolve Windows 11 Alt codes showing wrong characters by verifying the US keyboard layout and enabling Num Lock.

Read More
Run Programs with Elevated Privileges: A Comprehensive Guide

Eliminates the need to type sudo for frequent administrative tasks by configuring .bashrc aliases or functions.

Read More
Dynamically Changing Dates in Excel Formulas Using Cells

Eliminate manual date updates in Excel by using cell references to create dynamic formulas that automatically adjust calculations when input dates change.

Read More
Granting Edit Access to a Specific Excel Sheet in an Office 365 User Email ID-Based Login

Excel Online lacks native sheet-level permissions, so users must split workbooks or use worksheet protection to isolate edit access for specific tabs.

Read More
Creating Network Load on Local Wi-Fi from One PC

Generate sustained Wi-Fi bandwidth load from a single PC using a VM SFTP server to test router stability and throughput.

Read More
Changing the Default Editor for Batch Files in Windows 11's File Explorer

Resolve the issue of batch files opening in Notepad by changing the default editor to a preferred application like VS Code.

Read More
Gain WiFi Connection Minutes Before Losing it by Changing MAC Address

Bypass MAC address filtering to restore WiFi connectivity temporarily when a device is blocked by network administrators.

Read More
Photos Folders Turned Black: Troubleshooting Picture Applications on Windows

Resolve black screens in Windows Photos by resetting the app, updating graphics drivers, and repairing system files.

Read More
Troubleshooting High CPU Temperature Values: A Step-by-Step Guide

Resolve high CPU temperatures and thermal throttling by monitoring with Speedfan, cleaning dust from cooling components, and replacing degraded thermal paste.

Read More
Make cURL establish TLS connection with CA unknown

Resolve cURL TLS connection failures with unknown or self-signed certificates by using the --insecure flag to bypass CA validation.

Read More
Troubleshooting Incorrect Network Metrics Values in Grafana, Prometheus, InfluxDB, and Telegraf

Fix incorrect network metrics in Grafana, Prometheus, InfluxDB, and Telegraf by verifying interface selection, resolving unit mismatches, and handling counter resets.

Read More
Start Another Terminal Window (cmd.exe) Windows Repair/Troubleshoot

Provides step-by-step instructions to access the Windows Command Prompt via bootable media for advanced system repair and troubleshooting.

Read More
Thinkpad P1 Gen 6: Sudden Thunderbolt 3 Dock USB-C Charging Stopped Working

Resolve sudden Thunderbolt 3 dock USB-C charging and internet failure on ThinkPad P1 Gen 6 by updating firmware, resetting the dock, and adjusting power settings.

Read More
ASUS Windows 11 Laptop: Internet Connection Issue with Hotspot

Resolve ASUS Windows 11 laptop spinning wheel issue when connecting to mobile hotspot by resetting network stack, disabling IPv6, and adjusting power settings.

Read More
Developing iOS Project with Firebase: Logging in and Sending Push Notifications

Integrates Firebase to enable secure user authentication and push notifications in iOS applications.

Read More
Troubleshooting Bash Script with Suspected Issues of Spaces, Dashes, Filenames and Quoting

Resolve Bash script failures caused by word splitting, globbing, and special characters in filenames by applying proper quoting techniques.

Read More
Populating OneDrive Folder for Local Backup without Affecting Remote Files

Prevent OneDrive from deleting remote files during Windows reinstallation by unlinking the account or using symbolic links to isolate local data.

Read More
Force First Frame as Keyframe Without Re-encoding: A Quick Solution

Resolve inaccurate seeking and playback glitches by re-encoding video to ensure the first frame is a valid keyframe.

Read More
Find Information in Database Using WSL (Ubuntu) on Windows-10

Resolve database connection issues from WSL Ubuntu on Windows 10 by configuring client tools and network access to query remote or local servers.

Read More
Configuring a New Router with Different Networks: One Family, One Guest

Resolve IP conflicts and isolate guest traffic by configuring a second router with a distinct subnet via its WAN port.

Read More
Quickly Open Multiple Stock Websites with a Single Command

Solve the problem of manually opening multiple stock research websites by creating a single command to launch them simultaneously on Windows, macOS, or Linux.

Read More
Improved Adobe Acrobat Search Experience: Access Advanced Search with Ease

Access advanced search filters like case sensitivity and regex in Adobe Acrobat by clicking More Options in the Find bar.

Read More
Port Forwarding VM via OpenVPN: A Comprehensive Guide

Configure OpenVPN server and iptables to forward specific ports from VPN clients to a virtual machine's internal IP address.

Read More
Understanding Partitions in the 1980s: A Look Back at MS-DOS and Master Boot Record

Explains how the Master Boot Record and partition table enabled MS-DOS to manage multiple disk volumes on a single physical drive.

Read More
Windows 10 Enterprise: Keyboard Not Detected in Managed Organization with Admin Privileges

Resolve Windows 10 Enterprise keyboard detection failures caused by Group Policy restrictions, driver corruption, or USB enumeration errors.

Read More
Can't Find x86_64 Versions of Applications on MacOS arm64 (M1)

Resolve missing x86_64 app issues on M1 Macs by installing Rosetta 2 and reinstalling apps as universal binaries.

Read More
How to Hide Installation Source for an Android App

Manage Android app installation source visibility by using USB transfers or file managers to reduce browser traces and isolate data via work profiles.

Read More
Connecting Momentus 4200.2 ST9808210A Hard Drive via USB Cable

Resolve inability to access Seagate Momentus 4200.2 ST9808210A hard drive by connecting it via USB using a compatible SATA-to-USB adapter and configuring the disk in Windows.

Read More