The AWS CLI is a command-line tool to control and manage your AWS services. There are multiple ways of installing AWS CLI on Linux. You can install it using its bundled installer, irrespective of whether you have superuser permissions on your system.

Read on to know more about AWS CLI and how to install it on Linux.

Prerequisites for AWS CLI

AWS CLI installation requires Python on your Linux machine. Your system should have Python version 3.6 or above for installing AWS. You can install Python by downloading the archive from the official website. But first, you'll have to get some dependencies using APT. Issue the following commands one by one to download all the necessary dependencies:

        sudo apt install build-essential checkinstall
    
        sudo apt install libreadline-gplv2-dev libncursesw5-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
    

Install Python on Ubuntu

As soon as the system finishes installing the dependencies, download the Python archive using the wget command.

        wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tar.xz
    

Extract the package contents with the tar command.

        tar xvf Python-3.6.0.tar.xz
    

Change your current working directory to where the package was extracted using the cd command. Post completion, configure the compilation and install.

        cd Python-3.6.0/
    
        ./configure
    

In case you encounter an error message, issue the following command:

        ./configure --enable-optimizations
    

By using the make altinstall command instead of make install, you can skip the creation of the symbolic link. This step takes a little longer to run, so please be patient during the execution.

        sudo make altinstall
    

Related: AWS vs. Microsoft Azure: Which Cloud Service Is the Best?

Install AWS CLI Using the Bundled Installer

The bundled installer comes with all its inherent dependencies, making it perfect for offline installation. First, download the AWS CLI version 1 installer on your machine. You can use any of the following methods to download the installer bundle:

Download the installer through the terminal using the curl command:

        curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
    

Alternatively, you can also download the bundled installer by heading over to the official website.

Download: AWS CLI Version 1 Bundled Installer

Once the zip file is downloaded, extract the package using the built-in package manager on your Linux machine. You can also unzip the downloaded package from the terminal by issuing the following command:

        unzip awscli-bundle.zip
    

As soon as the unzipping procedure completes, run the installation command. Specify the installation path and symbolic link location to the installer using the -i and -b flags.

        sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
    

The system will now install AWC CLI version 1.

After the installation is complete, verify the installation by typing the following commands:

        aws --version
    

The system will display the following output if the installation was successful:

        aws-cli/1.15.58 Python/3.5.2 Linux/5.11.0-25-generic botocare/1.10.57
    

How to Uninstall AWS CLI Version 1

Removing AWS CLI from Ubuntu is a cakewalk. All you have to do is delete the installation directory and the symlinks created during installation.

        sudo rm -rf /usr/local/aws
    
        sudo rm /usr/local/bin/aws
    

Related: How to Become an Amazon Web Services Expert With BitDegree

Managing AWS Services From the Terminal

The AWS CLI is a handy tool for easily managing your AWS services. You can use the bundled installer to install AWS CLI. The bundled installer is great for offline installations but it involves more steps than the normal installation procedure.

You can also use PIP for installing AWS CLI on your Linux machine, in case you are a fan of quick installations. Either way, feel free to install/uninstall AWS CLI as per your requirements.

Cloud computing services are the solution to the growing server demands of many businesses. This is the prime reason why the trend of cloud development is skyrocketing. Hop onto the bandwagon by learning the ins and outs of Amazon Web Services today.