The AWS Command Line Interface (CLI) provides an efficient way to manage AWS services from a Linux terminal. Follow these steps to install AWS CLI Version 2 on a Linux system.
Open your terminal and execute the following command to download the AWS CLI installer zip file:
curl "<https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip>" -o "awscliv2.zip"
This command retrieves the AWS CLI installer and saves it as awscliv2.zip in the current directory.
Use the following command to extract the zip file:
unzip awscliv2.zip
If the unzip command is not installed on your system, you can install it by running:
sudo apt install unzip # For Ubuntu/Debian
sudo yum install unzip # For RHEL/CentOS
Run the installer as the root user by using sudo:
sudo ./aws/install
This will install the AWS CLI in /usr/local/bin/.
Run the following command to confirm the installation:
aws --version
If the installation is successful, you will see output similar to:
aws-cli/2.x.x Python/X.x.x Linux/x.x.x
This output confirms that AWS CLI Version 2 is installed and ready to use.
PATH Issues:
aws --version doesn't work, ensure /usr/local/bin is included in your system’s PATH variable.PATH using the following command:Add this line to your .bashrc or .zshrc file for persistence.
```bash
export PATH=$PATH:/usr/local/bin
```
Missing Dependencies:
curl and unzip installed before proceeding with the installation.