Skip to content

[v2] Implement macOS/Linux install script#10427

Open
hssyoo wants to merge 1 commit into
aws:install-updatefrom
hssyoo:install-update
Open

[v2] Implement macOS/Linux install script#10427
hssyoo wants to merge 1 commit into
aws:install-updatefrom
hssyoo:install-update

Conversation

@hssyoo

@hssyoo hssyoo commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Helper bash script to install AWS CLI v2 on macOS and Linux.

High-level overview:

  • Detect the system platform and architecture to download the right artifact.
  • The script is just a wrapper around the official installers. The same constraints apply to the script (eg Alpine not supported).
  • If --version isn't specified, it just grabs the latest version. The script fetches https://awscli.amazonaws.com/v2/version.txt in case the user already has the latest version installed in the configured path.
  • Signatures are verified. On macOS, the pkgutil tool used to verify the signature is a required dependency because it's available by default. On Linux, gpg is optional because it's not uncommon for Linux distros to not include them. A warning is emitted in this case.
  • Downgrades are not supported. We still expose a --version parameter so users can pin to a specific version in automation workflows.

Install layout

The main difference between the install script and official installers is that the script will not install system-wide by default (which requires sudo). Instead, it'll default to user-local installs, respecting XDG environment variables set by the user.

  • By default, install directory is $HOME/.local/share and bin directory is $HOME/.local/bin.
  • If XDG_DATA_HOME and XDG_BIN_HOME are set, then use those as install/bin dirs.
  • If --system flag is passed, then install system-wide to /usr/local/ and /usr/local/bin (same default behavior as installers today). Requires sudo.
    • 1 edge case here is that if sudo is run without the --system flag, then the install lands in the user's root $HOME. It also ignores XDG environment variables set by the user. We emit a warning in this case so the user knows where it was installed to and why.

install.json

This script introduces a new file called install.json that lives on disk in the install directory. It contains metadata about how the AWS CLI was installed. This needed to be distinct from metadata.json because metadata.json is created at build-time, whereas the information we need isn't known until install-time. install.json is used to assist the upcoming update command by preserving info on how it was originally installed.

@hssyoo hssyoo requested a review from a team as a code owner June 19, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant