DEV Community

Cover image for Installing and Updating AWS CLI on Linux
Unni P
Unni P

Posted on • Originally published at iamunnip.hashnode.dev

Installing and Updating AWS CLI on Linux

In this article we will look how we can install and update AWS CLI on Ubuntu distribution.

Prerequisites

Create an Ubuntu 22.04 LTS instance.

$ cat /etc/issue
Ubuntu 22.04.3 LTS \n \l
Enter fullscreen mode Exit fullscreen mode

Install some prerequisite packages. These packages are included by default in most major distributions of Linux.

$ sudo apt update

$ sudo apt install unzip glibc-source groff less
Enter fullscreen mode Exit fullscreen mode

Installing the CLI

Download the latest AWS CLI zip file.

$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
Enter fullscreen mode Exit fullscreen mode

Extract the downloaded zip file.

$ unzip awscliv2.zip
Enter fullscreen mode Exit fullscreen mode

Run the install program using elevated privileges.

$ sudo ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli
Enter fullscreen mode Exit fullscreen mode

Verify the version of CLI.

$ aws --version
aws-cli/2.13.32 Python/3.11.6 Linux/6.2.0-1012-aws exe/x86_64.ubuntu.22 prompt/off
Enter fullscreen mode Exit fullscreen mode

Updating the CLI

Download the latest AWS CLI zip file. Here we are using the same zip file downloaded earlier.

$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
Enter fullscreen mode Exit fullscreen mode

Extract the downloaded zip file with -u flag. This will automatically update existing files and create new ones as needed.

$ unzip -u awscliv2.zip
Enter fullscreen mode Exit fullscreen mode

Run the install program using elevated privileges with --update flag.

$ sudo ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update
Enter fullscreen mode Exit fullscreen mode

Verify the version of CLI.

$ sudo ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update
Found same AWS CLI version: /usr/local/aws-cli/v2/2.13.32. Skipping install.
Enter fullscreen mode Exit fullscreen mode

Reference

https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

Billboard image

Try REST API Generation for Snowflake

DevOps for Private APIs. Automate the building, securing, and documenting of internal/private REST APIs with built-in enterprise security on bare-metal, VMs, or containers.

  • Auto-generated live APIs mapped from Snowflake database schema
  • Interactive Swagger API documentation
  • Scripting engine to customize your API
  • Built-in role-based access control

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay