AWS CLI
upgrade
latest version
installation
cloud computing

How to upgrade AWS CLI to the latest version?

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Introduction

Upgrading AWS CLI is straightforward when your machine has a single installation method. Most failures happen when multiple installations exist, such as official installer plus pip plus package manager, and the shell resolves the wrong binary. A clean upgrade process starts with path auditing, uses one upgrade channel, and ends with real authentication and API checks.

Audit the Active AWS CLI Binary

Before changing anything, find the command your shell is actually executing.

On macOS or Linux:

bash
aws --version
which aws

On PowerShell:

powershell
aws --version
Get-Command aws | Select-Object Source

If you see unexpected paths, list all candidates in PATH and decide which install you want to keep. Upgrading one copy while using another is the most common source of confusion.

Choose One Installation Channel

Pick one method per machine and stick to it.

Common choices:

  • official AWS CLI v2 installer
  • Homebrew on macOS
  • winget or Chocolatey on Windows
  • distro package manager in managed Linux environments

Consistency matters more than tool preference. Mixed channels create drift and make incident debugging harder.

Upgrade with the Official Installer

Official installer is often the most predictable path for AWS CLI v2.

Linux x86_64 example:

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

macOS package example:

bash
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /

After install, open a new shell and verify the reported version and binary path.

Upgrade with Package Managers

If your organization standardizes on package managers, use that policy.

Homebrew:

bash
brew update
brew upgrade awscli

Windows winget:

powershell
winget upgrade --id Amazon.AWSCLI

Windows Chocolatey:

powershell
choco upgrade awscli -y

In managed fleets, keep version control in your configuration management so developers and CI workers do not drift.

Remove Legacy AWS CLI v1 Conflicts

Older environments may still include pip-based AWS CLI v1.

bash
python -m pip uninstall awscli

Then confirm active executable again:

bash
which aws
aws --version

If path still points to an unexpected location, inspect shell startup files for custom PATH edits.

Validate Functionality, Not Only Version

aws --version confirms binaries, but not credentials, profile resolution, or endpoint behavior. Run at least one authenticated command.

bash
aws sts get-caller-identity
aws configure list

If your team uses Single Sign-On, validate that flow too.

bash
aws sso login --profile dev
aws sts get-caller-identity --profile dev

These checks ensure the upgraded CLI still works with real authentication settings.

Upgrade Strategy for CI and Shared Hosts

For CI runners, bastion hosts, and build images, avoid in-place fleet-wide upgrades without staging.

Recommended rollout:

  1. upgrade one test image
  2. run smoke pipelines
  3. compare outputs against baseline
  4. promote gradually to production runner pools

Log CLI version in build jobs for traceability.

bash
aws --version

When incidents occur, version logs make regression analysis much faster.

Troubleshooting Quick Checks

If upgrade appears successful but behavior is wrong, check these quickly:

  • command path still points to removed install
  • shell session still using cached command location
  • broken profile path ordering
  • expired credentials interpreted as upgrade failure
  • old plugin or wrapper script intercepting aws

Refreshing shell hash cache can help on some shells.

bash
hash -r

Then rerun path and version checks.

Common Pitfalls

A common pitfall is upgrading via one method and running a binary from a different path. Another is leaving legacy pip v1 binaries ahead of v2 in command resolution. Teams also validate only aws --version and skip authenticated API calls, missing profile or SSO regressions. In CI, global upgrades without staged rollout can break deployment pipelines unexpectedly. Finally, installing from multiple channels on one machine makes ownership and troubleshooting unclear.

Summary

  • Identify the active aws binary path before upgrading.
  • Use one installation channel consistently on each machine.
  • Remove legacy v1 conflicts when present.
  • Validate with real AWS calls, not version output alone.
  • Roll out upgrades gradually on shared infrastructure with explicit version logging.

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.