How to Fix: aws --version error: bash: /usr/bin/aws: No such file or directory
AWS CLI installation issue with no solution found online.
📋 Table of Contents
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
- Step 1: Open the bash configuration file using the 'nano' editor: nano ~/.bashrc
- Step 2: Add the following line at the end of the file: export PATH=$PATH:/usr/local/bin"
- Step 3: Save and close the file, then restart the terminal or run 'source ~/.bashrc' to apply the changes.
- Step 4: Test the installation by running the command 'aws --version' again.
Creating a symbolic link to aws
- Step 1: Create a symbolic link to the aws executable file using the following command: ln -s /usr/local/bin/aws /bin/aws"
- 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.
❓ Frequently Asked Questions
🛠️ Related Fixes
How to Fix: Pc crashes shortly after launching game (rainbow
Fix Pc crashes shortly after launching game (rainbow six siege). Compl
How to Fix: Installing an APK on a locked down phone
Installing an APK on a locked down phone: Try using a rooted device, e
How to Fix: New PC build- no signal and no clue
Fix New PC build- no signal and no clue. Complete troubleshooting guid