TL;DR
- Linux AWS CLI v2 update: download the current zip, unzip it, then run
sudo ./aws/install --update. - Windows update: rerun the current AWS CLI v2 MSI installer from AWS.
- macOS update: use the same install method you used originally; Homebrew users can run
brew upgrade awscli. - Avoid
pip install --upgrade awscliunless you deliberately maintain AWS CLI v1.
Source check – May 10, 2026: AWS still recommends AWS CLI version 2 for current installs and updates. The official Linux command-line installer does not auto-update; AWS says to download a new installer and run it with the existing install paths and
--update. AWS also notes that third-party repositories may not contain the latest CLI v2 release.
| Topic | When | Command |
|---|---|---|
| Check installed version | Before changing anything | aws --version |
| Update Linux x86_64 | Official CLI v2 install | sudo ./aws/install --update |
| Update Windows | Admin PowerShell or CMD | msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msi |
Start here: If your only goal is to update AWS CLI v2, jump to PART 2; if aws --version shows aws-cli/1, read the install section first and plan a v1-to-v2 migration.
Fast path for a Linux x86_64 AWS CLI v2 update:
PART1: Install AWS CLI via Command Line
#1: Install the AWS CLI via the Command Line on Linux (Ubuntu) / WSL2
It’s good practice to check for existing installations of AWS CLI before installing. This can be done with
aws --versionStep 1: Update Package Lists
sudo apt update -yStep 2: Install unzip
Step 3: Download and Install the AWS CLI
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && unzip awscliv2.zip && sudo ./aws/install Note: if you are updating use:
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && unzip awscliv2.zip && sudo ./aws/install --updateStep 4: Verify Installation
aws --version#2: Install the AWS CLI via the Command Line on Windows using PowerShell
Step 1: Download the Installer
Remember you will need administrator privileges to perform these tasks:
Invoke-WebRequest -Uri https://awscli.amazonaws.com/AWSCLIV2.msi -OutFile .\AWSCLIV2.msi Step 2: Run the Installer
Double-click the downloaded “AWSCLIV2.msi” file and follow the on-screen instructions.
Step 3: Verify Installation
Open a new PowerShell window and run:
aws --version #3: Install the AWS CLI via the Command Line on MacOS (Terminal):
Step 1: Install Homebrew (if not already installed)
bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"Step 2: Install the AWS CLI
brew install awscliStep 3: Verify Installation
aws --versionPART 2: Update AWS CLI via Command Line
The update process depends on how the AWS CLI was installed. For AWS CLI v2, prefer the official AWS installer path on Linux and Windows. Package managers are convenient, but AWS does not guarantee that every third-party repository has the latest CLI v2 release.
#1: Update AWS CLI via the Command Line on Linux (Ubuntu)
Step 1: Update AWS CLI v2 with the Official Installer
If you are on Amazon Linux and your first update is replacing the old pre-installed package, remove the package-managed AWS CLI first with sudo yum remove awscli, then use the official AWS CLI v2 installer.
Step 2: Verify Update
aws --version #2: Update AWS CLI via the Command Line on Windows (PowerShell)
Step 1: Update with MSI Installer
If you originally installed the AWS CLI using the MSI installer, the recommended way to update is by downloading and running the latest MSI installer again from the official AWS website. This will overwrite the older version with the updated one.
Remember you will need administrator privileges to perform these tasks:
msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2.msiStep 2: Update with pip (Alternative)
Do not use pip install --upgrade awscli as the default update path for AWS CLI v2. The pip package path is for AWS CLI v1-style Python installs. If aws --version shows aws-cli/1, treat that as a migration decision rather than a normal v2 update.
Step 3: Verify Update
aws --version #3: Update AWS CLI via the Command Line on MacOS (Terminal)
Step 1: Update with brew
Brew, or Homebrew, is a free and open-source package manager for macOS (and Linux). It provides a simple way to update command-line tools. If you installed the AWS CLI using AWS’s macOS PKG installer instead, download and run the current PKG installer again rather than switching package managers midstream.
brew upgrade awscliStep 2: Verify Update
aws --version Important Notes:
- Administrative Privileges: You’ll likely need administrative rights (e.g.,
sudoon Linux/MacOS or running PowerShell as Administrator) to install or update system-wide. - Alternative Update Methods:
- Windows: If you installed using the MSI installer, you might need to download and re-run the latest installer to get updates.
- Linux: Some package managers (like
apt) might offer update mechanisms (sudo apt install --only-upgrade awscli).
- Shell Restart: After updating, it’s a good practice to restart your terminal or command prompt.
AWS CLI Q&A
What is the AWS CLI?
The AWS Command Line Interface (AWS CLI) is a unified tool used to manage Amazon Web Services (AWS) from the command line. It enables users to interact with AWS services and manage resources programmatically or via scripts. The AWS CLI is a powerful tool for developers, system administrators, and DevOps engineers to control AWS services without the need for a graphical interface.
Key Features:
- Unified Tool: AWS CLI allows users to control multiple AWS services from a single interface. You can manage compute resources, databases, storage, and more using commands.
- Automation and Scripting: AWS CLI supports automation by enabling users to write scripts that perform routine tasks, reducing the need for manual intervention. This is especially helpful for managing large infrastructures or for tasks such as deploying applications, monitoring resources, or configuring services.
- Cross-Platform: It works on multiple platforms, including Linux, macOS, and Windows. This makes it accessible to a broad range of users.
- Support for Multiple AWS Services: The AWS CLI supports virtually all AWS services, such as EC2, S3, Lambda, RDS, IAM, and more. This versatility allows you to manage nearly every aspect of AWS infrastructure from the command line.
- Direct Access to APIs: The AWS CLI provides direct access to AWS’s APIs, meaning the actions taken through the CLI closely mirror those you could perform programmatically via AWS SDKs.
- Credential Management: It integrates with AWS Identity and Access Management (IAM) to manage user access securely, allowing users to authenticate and authorize operations efficiently.
Common Use Cases:
- Resource Management: You can create, delete, or manage AWS resources like EC2 instances, S3 buckets, RDS databases, etc., using simple commands.
- Automation: Automating backup jobs, scaling instances, and managing infrastructure deployments via scripting and the AWS CLI.
- Monitoring: Query and retrieve logs, monitor services, or check resource statuses directly from the terminal.


Leave a Reply