Software⏱️ 3 min read📅 2026-06-11

How to Fix: aws --version error: bash: /usr/bin/aws: No such file or directory

AWS CLI installation issue with no solution found online.

Quick Answer: Try running the command using the full path of the executable, e.g., /usr/local/bin/aws --version.

The AWS CLI installation problem is a frustrating issue that can occur when installing the awscliv2 package. It affects users who have installed the AWS CLI using the instructions provided in the AWS documentation.

This error occurs when the system cannot find the aws executable file, despite having it installed in the correct location. The affected user has tried various solutions but was unable to resolve the issue.

⚠️ Common Causes

  • The primary reason for this error is that the aws executable file is not added to the system's PATH environment variable during installation. This means that when the user enters the 'aws' command, the system cannot find the executable file because it does not know where to look.
  • Another possible cause could be a misconfiguration of the package manager or an issue with the package installation process.

🔧 Proven Troubleshooting Steps

Adding aws to the PATH environment variable

  1. Step 1: Open the bash configuration file using the 'nano' editor: nano ~/.bashrc
  2. Step 2: Add the following line at the end of the file: export PATH=$PATH:/usr/local/bin"
  3. Step 3: Save and close the file, then restart the terminal or run 'source ~/.bashrc' to apply the changes.
  4. Step 4: Test the installation by running the command 'aws --version' again.

Creating a symbolic link to aws

  1. Step 1: Create a symbolic link to the aws executable file using the following command: ln -s /usr/local/bin/aws /bin/aws"
  2. Step 2: Test the installation by running the command 'aws --version' again.

🎯 Final Words

The solution to this problem involves adding the aws executable file to the system's PATH environment variable or creating a symbolic link to the file. By following these steps, users should be able to resolve the issue and successfully run the 'aws' command.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions