How to Install AWS Command Line Interface (awscli)?

By on June 14th, 2018

Amazon Web Services (AWS) offers a broad set of global compute, storage, database, analytics, application, and deployment services that help organizations move faster, lower IT costs, and scale applications. AWS supports command line interface tool. This will help you to manage many things from your Linux server or local machine. The package name of AWS command line interface tool is awscli. The package awscli is available in commonly using the package manager like YUM, APT, APT-GET etc. However, it’s not recommended to install using YUM or APT, because it is not guaranteed to be the latest version unless you get it from pip.  We can easily install awscli using Pip package. Pip is a package management system which is mainly used to install and manage software packages written in Python. In this documentation, we will discuss the installation of AWS command line interface tool using Pip package.

1) First, we need to check if the pip package is already installed on your machine or not. For this, please use the following command.

#pip –version

If it is not installed on your machine, then you need to install pip.

 

2) You can use the following installation steps for installing pip package. Run the following scripts. This script will download and installs the latest version of pip and another required package named setup tools.

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

# python get-pip.py –user

 

3) Check the current path by executing the following command.

# echo $PATH

 

4) In this next step, we need to add the local bin location to the current PATH variable which is the most important step.

Add the executable path to your PATH variable: ~/.local/bin. In this example, the path is  ~/.local/bin. The following command adds a path to the current PATH variable.

# export PATH=~/.local/bin:$PATH

 

5) Now we can load the profile into your current session which means you can find the shell’s profile script in your user folder.

# source ~/.profile

Now you can verify the pip is installed correctly or not by using the below command.

# $ pip –version

 

6) Now we can use the Pip package to install the awscli. The following command will also upgrade awscli tool.

# pip install awscli –upgrade –user

 

7) Using the below command, you can verify that the awscli is installed correctly or not.

#  aws –version

After installing with pip, you may need to add the aws executable to your OS’s PATH environment variable.

 

8) Now we can add the executable path to your PATH variable: ~/.local/bin. The following command adds a path, in this example, the path is  ~/.local/bin  to the current PATH variable.

# export PATH=~/.local/bin:$PATH

 

9) Load the profile into your current session.

# source ~/.profile

You can check with the following commands to know more details about the aws command line interface tool.

# aws help

# aws command help

# aws command subcommand help

If you need to uninstall the AWS CLI, use pip uninstall. You can use the following command.

#pip uninstall awscli

 

If you need any further assistance please contact our support department.

 

 

Leave a Reply