5

Is there anybody to try to put aws-cliv2 into raspberry pi? I've got an err msg below which expresses an exec format error.


[my env] (uname on my Raspberry Pi3) Linux raspberrypi 4.19.97-v7+ #1294 SMP Thu XXX XX XX:XX:XX GMT 2020 armv7l GNU/Linux

[err msg] pi@raspberrypi:~/XX/cdkContainer $ sudo ./aws/install ./aws/install: 78: ./aws/install: /XX/cdkContainer/aws/dist/aws: Exec format error You can now run: /usr/local/bin/aws --version

pi@raspberrypi:~/XX/cdkContainer $ aws --version bash: /usr/local/bin/aws: cannot execute binary file: Exec format error


I've just referred to an aws doc on the web site: However, It doesn't work on my Raspberry Pi 3.

shIbaInu42
  • 51
  • 1
  • 1
  • 3
  • 1
    You cannot execute x86 binaries on an ARM system without an emulator. You'll either have to find or (cross-)compile the program for ARM, or run it in an emulator, which will probably be very slow. – tttapa Mar 30 '20 at 10:35
  • @tttapa Thank you for your quick response! And I got it... – shIbaInu42 Mar 31 '20 at 13:36
  • So, I found aws-cli for python. I'm gonna try installing it ... – shIbaInu42 Mar 31 '20 at 13:40

4 Answers4

6

Same here..AWS Cli 2.0 docu page reports ARM, but only for 64 bit architecture, so you cannot use in raspbian. The only solution I found is to install aws-cli version 1 using pip.

python3 -m pip install aws-cli

Everything works.

rok
  • 2,574
  • 3
  • 23
  • 44
  • Thank you for replying! We've already gotten a cutting edge version to deal with this issue :) I mean that we can use aws cli v2 on raspbian :D https://aws.amazon.com/jp/blogs/developer/aws-cli-v2-now-available-for-linux-arm/ – shIbaInu42 Jun 14 '20 at 12:52
  • above msg to @rok – shIbaInu42 Jun 14 '20 at 12:54
  • 4
    @shlbalnu42 - that blog post is not correct. Downloading the awscli-exe-linux-aarch64.zip, extracting and running sudo ./aws/install on Raspbian produces the same "Exec format error". – lonstar Jun 18 '20 at 12:02
  • 1
    Exactly.. because Raspbian is not a 64 bit OS.. so there's no way that a 64bit binary can work there. – rok Jun 18 '20 at 15:10
  • 1
    https://docs.aws.amazon.com/cli/latest/userguide/install-linux.html#install-linux-bundled "Install and uninstall the AWS CLI version 1 on Linux using the bundled installer" install successfully on raspberry Pi 4 with Raspberry Pi OS (32-bit). Version 2 fails. – Gregory Bologna Jun 24 '20 at 02:05
  • Eventually: `pip install awscli` – ZabielskiGabriel Feb 21 '23 at 05:18
0

aws-cli v2 only supports 64-bit ARM, and your Raspberry Pi is presumably 32-bit, so it looks like what you're asking is simply impossible. The older aws-cli v1 does support Raspberry Pi though.

There is an open issue on Github where a dev confirmed the issue, but they currently have no fix planned.

Morten Lohne
  • 383
  • 2
  • 11
0

The issue you are facing I think as others mentioned is that you are perhaps running the 64-bit aws-cli version. I ran into this issue on my linux machine running an arm processor. The easiest solution was installing the linux arm version instead (see: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html).

If you already have a 64-bit version installed, you can just delete the 64-bit file, download the arm version and re-run the installation with an update flag:

sudo ./aws/install --update

Hope this helps anyone.

0

Windows Users

For those comming with a newly installed WSL Linux Ubuntu, you need to install pip python module and then install awscli :

sudo apt install python3-pip
pip install awscli

Then add the installed bin in your PATH (replace <MY_USER> with yours) :

  • zsh :

    echo "export PATH=$PATH:/home/<MY_USER>/.local/bin" >> ~/.zshrc
    
  • bash :

    echo "export PATH=$PATH:/home/<MY_USER>/.local/bin" >> ~/.bashrc
    

Finally check everything is good :

➜ aws --version
aws-cli/1.29.8 Python/3.10.6 Linux/5.15.90.1-microsoft-standard-WSL2 botocore/1.31.8
WannaGetHigh
  • 3,826
  • 4
  • 23
  • 31