Home / Cloud  / Amazon Services  / Set up and Update AWS CLI (awscli) tools on Linux using PIP

Set up and Update AWS CLI (awscli) tools on Linux using PIP

Do us a favor with share this post πŸ™‚

Here in this post we will going to again installation of Tool through another method using on Linux based flavour operating system like centos , rhel , fedora etc. tool is inbuilt in Amazon Linux AMI’s already.So if you are using Amazon Linux ami then you need to only update server pakcages after set up EC2 Instance.

Earlier we have installed EC2 API CLI tool which is composed in java and included shell scripts and Here we will using python based Β command line ec2 tool . Great Performance and large number of services support is available on python based Β tool Β instead of java composed tool .

Here we will follow below some steps to set upΒ AWS CLI

(1) Set up Β and Configure Β Python

(2) Β PIP Installation

(3) Install using pip

(4) Set up and configure Β Β 

(5) Check and Verify

AWS CLI Prerequisites :

Before installation it need soem prerequisites , Find below about requirement.

  • Here we are going to install in Linux based system , so it need Β Linux OS like CentOs , Red Hat ( RHEL ) etc.
  • Python version 2.6.5 or more upgraded Β should be install on server.
  • Pip install.

(1) Installation of Python :

Here i have used most latest version of python 3.5.0 . I have already post my article about Installation of Python 3Β .

Check Python version through below command.

#Β python –V
Output  Python 3.5.0

(2) Installation of PIP :

For installation of pip download script Β through below command.

#Β curl -O https://bootstrap.pypa.io/get-pip.py

Run the script to install pip.

# python get-pip.py
OUTPUT :  Collecting pip    ....  Downloading pip-7.1.2-py2.py3-none-any.whl (1.1MB)  100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.1MB 420kB/s  Collecting wheel  Downloading wheel-0.26.0-py2.py3-none-any.whl (63kB)  100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 65kB 6.7MB/s  Installing collected packages: pip, wheel  Successfully installed pip-7.1.2 wheel-0.26.0 .......................    

(3) Install AWS CLI using pip :

Now we are going to installa awscli after completing prerequisites requirement through below pip command.

# pip install awscli
OUTPUT :    Collecting awscli    Downloading awscli-1.8.13-py2.py3-none-any.whl (794kB) .....  100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 798kB 592kB/s  Collecting botocore==1.2.11 (from awscli)  Downloading botocore-1.2.11-py2.py3-none-any.whl (2.1MB)  100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2.1MB 226kB/s  Collecting rsa<=3.3.0,>=3.1.2 (from awscli)  Downloading rsa-3.2-py2.py3-none-any.whl (43kB)  100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 45kB 8.6MB/s  Collecting colorama<=0.3.3,>=0.2.5 (from awscli)  Downloading colorama-0.3.3.tar.gz  Collecting docutils>=0.10 (from awscli)  Downloading docutils-0.12.tar.gz (1.6MB)  100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.6MB 291kB/s  Collecting jmespath<1.0.0,>=0.7.1 (from botocore==1.2.11->awscli)  Downloading jmespath-0.9.0-py2.py3-none-any.whl    ....    Successfully installed awscli-1.8.13 botocore-1.2.11 colorama-0.3.3 docutils-0.12 jmespath-0.9.0 pyasn1-0.1.9 python-dateutil-2.4.2 rsa-3.2 six-1.10.0

(4) Set up and configure Β aws cli tool :

Now set upΒ aws Β for your Β aws panel details. Run below command and it will prompted to you for every field like aws secret key , aws Β access key , region etc… Run below command to configure aws cli. You can get Access key ID and Secret Access Key from Security Credententials form AWS.

#Β aws configure
OUTPUT :    aws configure  AWS Access Key ID [None]: XXXXXXXXXXXXXXXXXXXX  AWS Secret Access Key [None]: XXXXXXXXXXXXXXXXXXXXXXXX  Default region name [None]:us-east-1  Default output format [None]: table

Here provide access key and secret access key Β and region Β and format of table , I write table format . Your credentials and region and table format details will be save on Β .aws directory on config and credentials files which on home directory path of user Β like mine “~/.aws/config” and “~/.aws/credentials” .


# cat ~/.aws/config  [default]  output = table  region = us-east-1  #cat ~/.aws/credentials  [default]  aws_access_key_id = XXXXXXXXXXXXXXXX  aws_secret_access_key =XXXXXXXXXXXXXXXXXXXXXXX

(5) Check and Verify :

Now test for Β aws cli tool through below command . I have written two command below , you can use any one of them.

# aws ec2 describe-regions
# aws help

pip awscli aws tool aws ec2 cli AWS CLI


How to Upgrade AWS CLI Β ?


AWS Β development on tool always in process , they publish Β newer version of tools on some time interverval , so we need to require upgrade our Β AWS CLI Tool .

Here is below command to upgrade awscli tool.

#Β pip install --upgrade awscli

awscli is actual library of awscli tool.

Remove or Un install AWS CLIΒ 

If you want to uninstall aws cli from server . Run the below steps .

#pip uninstall awscli      
Do us a favor with share this post πŸ™‚

A Linux Geek with Freelance Contributor, Server/ Cloud Administrator having 6+ Years experience in Open Source and Cloud Technologies.

Review overview


Time limit is exhausted. Please reload CAPTCHA.