Install the latest version of the AWS CLI & botocore for Ubuntu 22.04.2 LTS

AWS CLI setup

Ref: Official Documentation


* Download the awscli bundle to your machine using the below curl command

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


* Unzip the file using the below command

unzip awscliv2.zip


* Now for installing AWS CLI use the below command

sudo ./aws/install

* To check the installed version and details of AWS CLI

aws --version



Botocore setup

Ref: Official Documentation

* Create a new pip_install.sh file and paste the below script and run the bash script 

#!/bin/sh
if echo $(python3 -V 2>&1) | grep -e "Python 3.6"; then
sudo wget https://bootstrap.pypa.io/pip/3.6/get-pip.py -O /tmp/get-pip.py
elif echo $(python3 -V 2>&1) | grep -e "Python 3.5"; then
sudo wget https://bootstrap.pypa.io/pip/3.5/get-pip.py -O /tmp/get-pip.py
elif echo $(python3 -V 2>&1) | grep -e "Python 3.4"; then
sudo wget https://bootstrap.pypa.io/pip/3.4/get-pip.py -O /tmp/get-pip.py
else
sudo apt-get -y install python3-distutils
sudo wget https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py
fi


* Run below command to exicute the newly created bash script , and it will install
required pip version

bash pip_install.sh

* Run the following commands to install botocore.


sudo python3 /tmp/get-pip.py

sudo pip3 install botocore