Post

Installing, uninstalling or updating the latest version of the AWS CLI

Linux

Install or update the AWS CLI

*Linux x86 (64-bit):

1
2
3
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

*Linux ARM

1
2
3
curl "https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

Uninstall the AWS CLI

  1. Locate the symlink and install paths. Use the which command to find the symlink.
1
2
which aws
/usr/local/bin/aws

Use ls command to find the directory that the symlink points to.

1
2
ls -l /usr/local/bin/aws
lrwxrwxrwx 1 ec2-user ec2-user 49 Oct 22 09:49 /usr/local/bin/aws -> /usr/local/aws-cli/v2/current/bin/aws
  1. Delete the two symlinks
1
2
sudo rm /usr/local/bin/aws
sudo rm /usr/local/bin/aws_completer
  1. Delete the install directory.
1
sudo rm -rf /usr/local/aws-cli
  1. (Optional) Remove the shared AWS SDK and AWS CLI settings information in the .aws folder.
1
sudo rm -rf ~/.aws/

References

This post is licensed under CC BY 4.0 by the author.