9

What is the best way to install the aws cli?

There are a few conflicting resources about this online.

Ulad Kasach
  • 1,874
  • sudo apt install awscli or in a Python virtual environment (will not require sudo) python -m pip install awscli (https://pypi.org/project/awscli/). Avoids all the hassle with snaps and installer downloads and allows easy update. – NeilG May 18 '23 at 06:20
  • One thing that you need to be aware of is that AWS have released a version 2 of the CLI that has features that may be important to you such as aws configure sso. AWS has not released a PyPi package for version 2 and I can't find an apt package for version 2. If you are in need of version 2 it looks like the official AWS install method is required. There is a third party PyPi package for version 2 but I had problems with it. – NeilG Jun 02 '23 at 02:11

2 Answers2

9

Per https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
Ulad Kasach
  • 1,874
6

This can be installed with snap

sudo snap install aws-cli --classic

https://snapcraft.io/aws-cli

Ulad Kasach
  • 1,874