'How to install awscli version 2 on raspberry pi

sudo apt install awscli installs currently version 1.16.113-1

The official website (https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html) supports aarch64 but not armhf. Is there another way or something that I am missing. The differences between v1 and v2 are not that big but for example v1 does not support --storage-class DEEP_ARCHIVE



Solution 1:[1]

Got this to work on a Raspberry Pi 2 by checking out and installing directly from the awscli v2 branch on github.

You'll need to run a modern python (3.6+?), so the whole procedure is isolated in its own venv so as not to mess up system python.

Based roughly on these directions https://github.com/aws/aws-cli/tree/v2#cli-dev-version we get:

$ git clone https://github.com/aws/aws-cli.git
$ cd aws-cli && git checkout v2
$ pip3 install -r requirements.txt
$ pip3 install .

$ aws --version
aws-cli/2.1.14 Python/3.9.1 Linux/4.19.66+ source/armv6l.raspbian.9 prompt/off

Solution 2:[2]

You can install this now from an official download here: https://aws.amazon.com/blogs/developer/aws-cli-v2-now-available-for-linux-arm/

Solution 3:[3]

aws cli v2 is still not available in the Python Package Index(PyPI) repository. I have passed the instruciton below for "How to install aws cli v2"

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

how to configure aws cli v2 command line completion permanently

complete -C '/usr/local/bin/aws_completer' aws
echo "complete -C '/usr/local/bin/aws_completer' aws" >>  ~/.bashrc 
source ~/.bashrc  

now you can check by typing any partial command and press the tab key aws s<TAB>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 James Beard
Solution 2 rrodakowski
Solution 3 linux.cnf