Cannot install AWS CLI v2 on Raspberry pi 4B+ with Raspbian GNU/Linux 10(buster)

0

I tried to install AWS CLI v2 on raspberry pi 4 model b+ with Raspbian GNU/Linux 10 following step.

But I confronted /usr/local/bin/aws: No such file or directory error when checking aws cli verison by using aws --version command.

Is it possible to install AWS CLI v2 on raspberry pi 4 model b+ with Raspbian OS for ARM64 ?

Install step

$ curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
$ unzip awscliv2.zip
$ sudo ./aws/install -i /usr/local/aws-cli -b /usr/local/bin

Error message

./aws/install: 78: ./aws/install: /home/pi/aws/dist/aws: not found
You can now run: /usr/local/bin/aws --version
$ aws --version
/usr/local/bin/aws: No such file or directory

Supplimental information is as follow for futher analysis.

$ uname -a
Linux rapsberrypi4 6.1.20-v8+ #1638 SMP PREEMPT Tue Mar 21 17:16:29 GMT 2023 aarch64 GNU/Linux

$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
asked a year ago1009 views
2 Answers
0

Hello,

You can install AWS CLI v2 on raspberry pi 4 model b+ with Raspbian OS for ARM64.


The error "/usr/local/bin/aws: No such file or directory" usually indicates that the AWS CLI binary is not installed or not in the expected location. Please refer the following steps to troubleshoot the issue.

  1. Uninstall AWS CLI and re-install it again

    => Please refer the article Uninstalling the AWS CLI version 2 to uninstall the CLI

    => Re-install the AWS CLI: Installing or updating the latest version of the AWS CLI

curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip " -o "awscliv2.zip "
unzip awscliv2.zip 
sudo ./aws/install -i /usr/local/aws-cli -b /usr/local/bin
  1. If AWS CLI is installed but not in the expected location, you can check where it is installed by running the following command:
$ which aws

This will give you the path where AWS CLI is installed. If it is not installed in "/usr/local/bin/aws", you may need to update your environment variables to point to the current location.

  1. If you have updated your environment variables, and are still experiencing the error, you can try adding the path to the AWS CLI binary to your PATH variable as follows:
Syntax: 
export PATH=/path/to/awscli/bin:$PATH   #Replace /path/to/awscli/bin with the actual path to the AWS CLI binary

Example:
$ sudo export PATH=/usr/local/bin:$PATH

Let me know if you have any further queries. Thank you for your interest in re:Post community.

Best Regards, Ashish

Refer Re:Post Installing AWS CLI v2 on Raspberry Pi 4B with Raspbian OS

AWS
SUPPORT ENGINEER
answered a year ago
0

Hello, Ashish.

Thank you for your quick feedback above !

According to your above procedure, I uninstall and re-install AWS CLI but detected same error "Not such file or directory".

In addition, regarding the path to the AWS CLI binary, it looks like adding the path which AWS CLI is installed correctly.

For further analysis, I wrote a series of steps as follow.

pi@rapsberrypi4:~ $ sudo ./aws/install -i /usr/local/aws-cli -b /usr/local/bin
./aws/install: 78: ./aws/install: /home/pi/aws/dist/aws: not found
You can now run: /usr/local/bin/aws --version
pi@rapsberrypi4:~ $ which aws
/usr/local/bin/aws
pi@rapsberrypi4:~ $ echo $PATH
/home/pi/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
pi@rapsberrypi4koba:~ $ aws --version
bash: /usr/local/bin/aws: Not such file or directory

After that, I checked directory to install AWS CLI binary and it appears that there is "aws" in ../dist/aws as follow.

But this aws failed to run.

pi@rapsberrypi4:~ $ ls /usr/local/bin -la
...
lrwxrwxrwx  1 root root    37  4月  4 22:27 aws -> /usr/local/aws-cli/v2/current/bin/aws
lrwxrwxrwx  1 root root    47  4月  4 22:27 aws_completer -> /usr/local/aws-cli/v2/current/bin/aws_completer

pi@rapsberrypi4:/usr/local/aws-cli/v2/current/bin $ ls -la
lrwxrwxrwx 1 root root   11  4月  4 22:27 aws -> ../dist/aws
lrwxrwxrwx 1 root root   21  4月  4 22:27 aws_completer -> ../dist/aws_completer

pi@rapsberrypi4:/usr/local/aws-cli/v2/current/bin$ cd ../dist/
pi@rapsberrypi4:/usr/local/aws-cli/v2/current/dist$ ls -la
...
-rwxr-xr-x 1 root root  6636240  4月  5 21:01 aws

I did above procedure twice. But the result was same.

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions