In this blog post, I will show you to install AWS CLI version 2 on Linux CentOS and avoid common issues.
Check PATH
The first thing you need to check which paths are configured in your $PATH and note down a path you would like to install the CLI.
To check you paths run:
echo $PATH

In my case, I will install in on /usr/bin because it is in my $PATH.
Install
Once you know the path, run the following commands:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
Note: Below I am specifying the path, if you don’t do that it wil go to /usr/local/bin/aws and you will get an error (bash: aws: command not found).
./aws/install -i /usr/bin/aws-cli -b /usr/bin
check installation
If you followd this guide correcty you should the AWS version when running
aws --version

Processing…
Success! You're on the list.
Whoops! There was an error and we couldn't process your subscription. Please reload the page and try again.