How to Resolve the AWS Version Error bash _usr_bin_aws No such file or directory
Rate this post

Last Updated on July 7, 2023 by Vikash Ekka

If you are encountering the AWS version error that says “bash: /usr/bin/aws: No such file or directory,” don’t worry.

In this article, we will guide you through the steps to resolve this issue.

Also Read:

How to enable access logs for alb on s3 bucket

Setup Email Notification for Ec2 disk alert

AWS (Amazon Web Services) is a widely used cloud computing platform that offers a range of services to help businesses and individuals build and manage their applications. However, encountering errors while working with AWS is not uncommon. One such error is the AWS version error, which can occur when the AWS Command Line Interface (CLI) is unable to locate the required executable file.

In the following sections, we will explore the reasons behind the “bash: /usr/bin/aws: No such file or directory” error and provide step-by-step instructions to resolve it.

Understanding the AWS Version Error

The “bash: /usr/bin/aws: No such file or directory” error typically indicates that the AWS CLI executable file is missing or cannot be found in the specified directory. The AWS CLI is a powerful tool that enables users to interact with various AWS services through the command line. Without the AWS CLI, you may encounter difficulties managing your AWS resources and performing essential tasks.

To rectify this error, let’s go through the troubleshooting steps outlined below.

1. Troubleshooting Steps

The first step is to verify whether the AWS CLI is installed on your system. Open your terminal and run the following command:

aws --version

If the command returns the “bash: /usr/bin/aws: No such file or directory” error, it means that the AWS CLI is not installed. In such a case, proceed to the next step to install or update the AWS CLI.

2. Updating AWS CLI

If you already have the AWS CLI installed but are encountering the version error, it might be due to an outdated version. To update the AWS CLI, follow these steps:

Open your terminal and run the following command to update the AWS CLI:

pip install --upgrade awscli

Wait for the update process to complete. This will ensure that you have the latest version of the AWS CLI installed.

Once the update is finished, run the command aws --version again to verify if the error persists. If the error persists, proceed to the next troubleshooting step.

3. Verifying the AWS CLI Path

In some cases, the AWS CLI executable file might not be in the correct directory, leading to the “bash: /usr/bin/aws: No such file or directory” error. Follow these steps to verify the AWS CLI path:

Open a terminal and run the following command to find the location of the AWS CLI executable:

which aws

The command will return the path where the AWS CLI executable is located. Ensure that the path is set correctly.

If the path is incorrect or differentfrom /usr/bin/aws, you need to update it. To do this, open the file ~/.bash_profile (or ~/.bashrc if using a different shell) in a text editor and add the following line:

export PATH=/new/path/to/aws-cli:$PATH

Replace /new/path/to/aws-cli with the correct path to the AWS CLI executable.

Save the file and exit the text editor. Then, run the command source ~/.bash_profile (or source ~/.bashrc) to apply the changes.

Finally, run the command hash aws to update the location of the AWS CLI executable in the shell’s command lookup hash table.

Run the command aws --version to verify if the error has been resolved. If the error still persists, consider reinstalling the AWS CLI.

Conclusion

Encountering the AWS version error “bash: /usr/bin/aws: No such file or directory” can be frustrating, but by following the troubleshooting steps outlined in this article, you should be able to resolve the issue. Ensure that you have the AWS CLI installed, update it to the latest version, and verify the correct path to the executable file.

By Vikash Ekka

Hi All, My name is Vikash Ekka from India. I’m the founder and tech editor of https://www.vetechno.in. I have completed my Graduation in BCA. I love to write technical articles like Windows, Linux & MAC Tutorials, Tips, Tricks, How To fix, Tutorials About Ethical Hacking & Cyber Security Guide, and Software Review. Currently, I have been working as an IT professional since 2018.

Leave a Reply

Your email address will not be published. Required fields are marked *