How to install AWS CLI on Ubuntu 22.04

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

Hello, friends. In this post, you will learn how to install AWS-cli on Ubuntu 22.04 in the easiest way possible.

Introduction

According to the AWS website:

The AWS Command Line Interface (AWS CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.

In other words, it is one of the most important applications in the entire AWS environment because with it, we can manage the services. So for every server professional, it is an essential tool at work.

The process is simple and within everyone’s reach.

Let’s go for it.

Install AWS CLI on Ubuntu 22.04

To do this post, we have two main options. Both are easy, but it will be up to your choice.

Method 1: Install AWS CLI using the official Ubuntu repositories

Fortunately, AWS CLI is present in the official Ubuntu 22.04 repositories. This makes it easy to install, but also ensures integration with the system.

First, open a terminal and update the system

sudo apt update
sudo apt upgrade

The next step is to look for the AWS CLI package

sudo apt show awscli
AWS CLI package info
AWS CLI package info

This will provide you valuable information about the package and the tool.

Then, you can install AWS CLI by simply running

sudo apt install awscli
Install AWS CLI on Ubuntu 22.04

Then all that remains is to check the installed version with the following command

aws --version

Sample output

aws-cli/1.22.34 Python/3.10.4 Linux/5.15.0-46-generic botocore/1.23.34

And that’s it.

Method 2: Installing AWS CLI using the official installation script (Recommended)

The second way to install AWS CLI is to do it using an official installation script provided by Amazon.

To achieve this, just download the script with the following command

curl https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip -o awscliv2.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 44.8M  100 44.8M    0     0   172M      0 --:--:-- --:--:-- --:--:--  172M

Then, unzip it using unzip.

unzip awscliv2.zip

If you don’t have unzip installed, just run this command to install it

sudo apt install unzip

Thereafter, you just need to install it

sudo ./aws/install
You can now run: /usr/local/bin/aws --version

By default, the files are all installed to /usr/local/aws-cli, and a symbolic link is created in /usr/local/bin. So, check the installed version:

aws --version

Sample Output

aws-cli/2.7.34 Python/3.9.11 Linux/5.15.0-46-generic exe/x86_64.ubuntu.22 prompt/off

And just like that, you have it.

Conclusion

In this post, you learned how to install AWS CLI in Ubuntu 22.04. If you are learning about this topic, it will be useful.

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"
Angelo
Angelo
I am Angelo. A systems engineer passionate about Linux and all open-source software. Although here I'm just another member of the family.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook