sudo apt update
sudo apt install -y unzip curl
mkdir -p ~/.local/aws-cli
cd ~/.local/aws-cli
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
ls -l awscliv2.zip # Verify the download was successful.
unzip awscliv2.zip # Unzip the downloaded file
ls -l # Should show a directory named `aws`
Run the install script with the --install-dir and --bin-dir options:
./aws/install --install-dir ~/.local/aws-cli --bin-dir ~/.local/bin
--install-dir : Specifies where to install AWS CLI--bin-dir : Specifies where to create symlinks to aws and aws_completerOpen your shell profile file:
nano ~/.bashrc # For Bash users
# OR
nano ~/.zshrc # For Zsh users
Add the following line at the end:
export PATH="$HOME/.local/bin:$PATH"
Save and close the file.
source ~/.bashrc # For Bash
# OR
source ~/.zshrc # For Zsh
aws --version
You should see output like:
aws-cli/2.x.x Python/3.x.x Linux/...
If you already have AWS credentials:
aws configure