I Updated the macOS and CloudShell Environments with the aws update Command and Compared the Differences

I Updated the macOS and CloudShell Environments with the aws update Command and Compared the Differences

I actually upgraded using the aws update command! It turns out aws --version shows the installation method, so I looked into that a bit.
2026.10.31

This page has been translated by machine translation. View original

Hello, this is Usuda.

Everyone, are you using the AWS CLI? (greeting)

The other day I tried the aws update command in the AWS CLI, but at that time I hadn't actually done the update.

https://dev.classmethod.jp/articles/aws-update-command-with-gpg/

After some time had passed, I thought "maybe it works now?" and tried the actual update behavior. Something caught my attention, so I did a bit of additional research.

I tried updating on macOS

Here is how it went. This is an update from AWS CLI 2.38.5 to 2.39.3.

% aws --version
aws-cli/2.38.5 Python/3.14.8 Darwin/24.6.0 script-exe/arm64
% aws update
Updating AWS CLI (source: script-exe)
Downloading https://awscli.amazonaws.com/v2/install.sh
Downloading https://awscli.amazonaws.com/v2/install.sh.sig
Install script signature verified.
Running install script...
Resolving user-local install paths:
  HOME=/Users/your-name
  XDG_DATA_HOME=/Users/your-name/.local/share
  XDG_BIN_HOME=/Users/your-name/.local/bin
Installing AWS CLI 2.38.5 → 2.39.3
Downloading AWS CLI installer from https://awscli.amazonaws.com/AWSCLIV2-2.39.3.pkg?src=update-exe
############################################################################################# 100.0%
PKG code signature verified (team 94KV3E626L).
installer: Package name is AWS Command Line Interface
installer: choices changes file '/var/folders/xx/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/T/tmp.XXXXXXXXXX/choices.xml' applied
installer: Upgrading at base path /Users/your-name
installer: The upgrade was successful.
AWS CLI 2.39.3 installed to /Users/your-name/.local/share/aws-cli
Ensure /Users/your-name/.local/bin is on your PATH. When multiple installs exist, PATH order determines which 'aws' runs.

Tip: run 'aws configure agent-toolkit' to set up AWS skills and the AWS MCP server for your AI coding agent(s).

This is the result after installation.

% aws --version
aws-cli/2.39.3 Python/3.14.8 Darwin/24.6.0 update-exe/arm64

Oh, it was properly upgraded!

But wait a moment. Something other than the version has changed too, hasn't it?

% aws --version
aws-cli/2.38.5 Python/3.14.8 Darwin/24.6.0 script-exe/arm64
% aws --version
aws-cli/2.39.3 Python/3.14.8 Darwin/24.6.0 update-exe/arm64 # <-- around here

Do you see it? What was script-exe/arm64 before the update has become update-exe/arm64!

So I investigated this part a bit further.

The meaning of the aws --version output

I checked what is displayed when you run aws --version.

The output of aws --version is assembled by CLIDriver._cli_version() in awscli/clidriver.py. It looks like this:

  • CLI name/version: aws-cli/2.39.3
  • Python version: Python/3.14.8
  • OS name/release: Darwin/24.6.0
  • Execution environment: no output
  • Installation method: update-exe
  • CPU architecture: arm64
  • Linux distribution: no output

So script-exe and update-exe were being displayed as the installation method. And in the case of aws update, it seems this gets overwritten onto the existing value.

So what other installation methods are there?

The value of the installation method is determined by awscli/clidriver.py: get_distribution_source().

It reads the files in the order awscli/data/install.json → awscli/data/metadata.json and returns the value of distribution_source. If neither has a value, it becomes other.

The values I could confirm from the code and documentation are as follows.

  • exe: Official installer (pkg/zip/msi)
  • script-exe: Install script
  • update-exe: aws update
  • source: Default value of metadata.json included in the repository
  • source-sandbox: Built from source (--with-install-type=system-sandbox)
  • source-exe: Built from source (--with-install-type=portable-exe)
  • other: When there is no distribution_source

Of these, the only ones supported by aws update are the three listed in update.py: _SUPPORTED_SOURCES: exe, script-exe, and update-exe.

_SUPPORTED_SOURCES = ('exe', 'script-exe', 'update-exe')

So it turns out that depending on the installation method, you can't use aws update. I see.

This is also currently stated in the English user guide as follows.

Starting with version 2.36.0, if you installed the AWS CLI using the install script or an official installer (the Linux command line installer, the macOS PKG installer, or the Windows MSI installer), you can update to the latest version by running the following command.

Starting with version 2.36.0, if you installed the AWS CLI using the install script or an official installer (the Linux command line installer, the macOS PKG installer, or the Windows MSI installer), you can update to the latest version by running the following command.

I tried it on AWS CloudShell too

The output on a Linux environment will probably differ somewhat, so let's look at the behavior in an AWS CloudShell environment as well.

I went to a region I don't normally use and ran the AWS CLI in a clean environment. First, checking the version.

~ $ aws --version
aws-cli/2.38.6 Python/3.14.8 Linux/6.1.188-233.393.amzn2023.x86_64 exec-env/CloudShell exe/x86_64.amzn.2023

The execution environment exec-env/CloudShell, which did not appear on macOS, and the Linux distribution .amzn.2023 are now output.

Now let's update this one too.

~ $ aws update
Updating AWS CLI (source: exe)

aws: [ERROR]: Updating a system-wide AWS CLI installation requires root.

It seems sudo is required.

~ $ sudo aws update
Updating AWS CLI (source: exe)
Downloading https://awscli.amazonaws.com/v2/install.sh
Downloading https://awscli.amazonaws.com/v2/install.sh.sig
Install script signature verified.
Running install script...
Installing AWS CLI 2.38.6 → 2.39.3
Downloading AWS CLI installer from https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.39.3.zip?src=update-exe
################################################################################################################################################################################################# 100.0%
Downloading AWS CLI signature from https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.39.3.zip.sig?src=update-exe
################################################################################################################################################################################################# 100.0%
GPG signature verified.
You can now run: /usr/local/bin/aws --version
AWS CLI 2.39.3 installed to /usr/local/aws-cli
Ensure /usr/local/bin is on your PATH. When multiple installs exist, PATH order determines which 'aws' runs.

Tip: run 'aws configure agent-toolkit' to set up AWS skills and the AWS MCP server for your AI coding agent(s).

It was updated. Let's check.

~ $ aws --version
aws-cli/2.39.3 Python/3.14.8 Linux/6.1.188-233.393.amzn2023.x86_64 exec-env/CloudShell update-exe/x86_64.amzn.2023

It was updated properly. And the installation method has become update-exe here as well.

Summary

I actually tried the aws update command. It turns out aws --version shows the installation method, and that it changes after updating is a subtle but interesting point.

Updating has also become easier in AWS CloudShell, so let's make good use of it!

Share this article

AWSのお困り事はクラスメソッドへ