Install past releases of the AWS CLI version 2
This topic describes how to install the past releases of the AWS Command Line Interface version 2 (AWS CLI)
on supported operating systems. For information on the AWS CLI version 2 releases, see the AWS CLI version 2
Changelog
AWS CLI version 2 installation instructions:
Installation requirements
-
You know which release of the AWS CLI version 2 you'd like to install. For a list of versions, see the AWS CLI version 2 Changelog
on GitHub. -
You must be able to extract or "unzip" the downloaded package. If your operating system doesn't have the built-in
unzipcommand, use an equivalent. -
The AWS CLI version 2 uses
glibc,groff, andless. These are included by default in most major distributions of Linux. -
We support the AWS CLI version 2 on 64-bit versions of recent distributions of CentOS, Fedora, Ubuntu, Amazon Linux 1, Amazon Linux 2 and Linux ARM.
-
Because AWS doesn't maintain third-party repositories, we canβt guarantee that they contain the latest version of the AWS CLI.
Installation instructions
Follow these steps from the command line to install the AWS CLI on Linux.
We provide the steps in one easy to copy and paste group based on whether you use 64-bit Linux or Linux ARM. See the descriptions of each line in the steps that follow.
-
Download the installation file in one of the following ways:
(Optional) Verifying the integrity of your downloaded zip file
If you chose to manually download the AWS CLI installer package
.zipin the above steps, you can use the following steps to verify the signatures by using theGnuPGtool.The AWS CLI installer package
.zipfiles are cryptographically signed using PGP signatures. If there is any damage or alteration of the files, this verification fails and you should not proceed with installation.-
Download and install the
gpgcommand using your package manager. For more information aboutGnuPG, see the GnuPG website. -
To create the public key file, create a text file and paste in the following text.
-----BEGIN PGP PUBLIC KEY BLOCK----- mQINBF2Cr7UBEADJZHcgusOJl7ENSyumXh85z0TRV0xJorM2B/JL0kHOyigQluUG ZMLhENaG0bYatdrKP+3H91lvK050pXwnO/R7fB/FSTouki4ciIx5OuLlnJZIxSzx PqGl0mkxImLNbGWoi6Lto0LYxqHN2iQtzlwTVmq9733zd3XfcXrZ3+LblHAgEt5G TfNxEKJ8soPLyWmwDH6HWCnjZ/aIQRBTIQ05uVeEoYxSh6wOai7ss/KveoSNBbYz gbdzoqI2Y8cgH2nbfgp3DSasaLZEdCSsIsK1u05CinE7k2qZ7KgKAUIcT/cR/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nImYHKuaKS9LVaCoC8vu7 IRBik1NX6SjrQnftk0M9dY+s0ZbAN1gbdjZ8H3qlbl/4TxMdr87m8LP4FZIIo261 Eycv34pVkCePZiP+dgamEiQJ7IL4ZArio9mv6HbDGV6mLY45+l6/0EzCwkI5IyIf BfWC9s/USgxchg== =ptgS -----END PGP PUBLIC KEY BLOCK-----For reference, the following are the details of the public key.
Key ID: A6310ACC4672 Type: RSA Size: 4096/4096 Created: 2019-09-18 Expires: 2025-07-24 User ID: AWS CLI Team <aws-cli@amazon.com> Key fingerprint: FB5D B77F D5C1 18B8 0511 ADA8 A631 0ACC 4672 475C -
Import the AWS CLI public key with the following command, substituting
public-key-file-namewith the file name of the public key you created.$gpg --importpublic-key-file-namegpg: /home/username/.gnupg/trustdb.gpg: trustdb created gpg: key A6310ACC4672475C: public key "AWS CLI Team <aws-cli@amazon.com>" imported gpg: Total number processed: 1 gpg: imported: 1 -
Download the AWS CLI signature file for the package you downloaded. It has the same path and name as the
.zipfile it corresponds to, but has the extension.sig. In the following examples, we save it to the current directory as a file namedawscliv2.sig. -
Verify the signature, passing both the downloaded
.sigand.zipfile names as parameters to thegpgcommand.$gpg --verify awscliv2.sig awscliv2.zipThe output should look similar to the following.
gpg: Signature made Mon Nov 4 19:00:01 2019 PST gpg: using RSA key FB5D B77F D5C1 18B8 0511 ADA8 A631 0ACC 4672 475C gpg: Good signature from "AWS CLI Team <aws-cli@amazon.com>" [unknown] gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: FB5D B77F D5C1 18B8 0511 ADA8 A631 0ACC 4672 475CImportant
The warning in the output is expected and doesn't indicate a problem. It occurs because there isn't a chain of trust between your personal PGP key (if you have one) and the AWS CLI PGP key. For more information, see Web of trust
.
-
-
Unzip the installer. If your Linux distribution doesn't have a built-in
unzipcommand, use an equivalent to unzip it. The following example command unzips the package and creates a directory namedawsunder the current directory.$unzip awscliv2.zip -
Run the install program. The installation command uses a file named
installin the newly unzippedawsdirectory. By default, the files are all installed to/usr/local/aws-cli, and a symbolic link is created in/usr/local/bin. The command includessudoto grant write permissions to those directories.$sudo ./aws/installYou can install without
sudoif you specify directories that you already have write permissions to. Use the following instructions for theinstallcommand to specify the installation location:-
Ensure that the paths you provide to the
-iand-bparameters contain no volume name or directory names that contain any space characters or other white space characters. If there is a space, the installation fails. -
--install-diror-iβ This option specifies the directory to copy all of the files to.The default value is
/usr/local/aws-cli. -
--bin-diror-bβ This option specifies that the mainawsprogram in the install directory is symbolically linked to the fileawsin the specified path. You must have write permissions to the specified directory. Creating a symlink to a directory that is already in your path eliminates the need to add the install directory to the user's$PATHvariable.The default value is
/usr/local/bin.
$./aws/install -i/usr/local/aws-cli-b/usr/local/binNote
To update your current installation of the AWS CLI version 2 to a newer version, add your existing symlink and installer information to construct the
installcommand with the--updateparameter.$sudo ./aws/install --bin-dir/usr/local/bin--install-dir/usr/local/aws-cli--updateTo locate the existing symlink and installation directory, use the following steps:
-
Use the
whichcommand to find your symlink. This gives you the path to use with the--bin-dirparameter.$which aws/usr/local/bin/aws -
Use the
lscommand to find the directory that your symlink points to. This gives you the path to use with the--install-dirparameter.$ls -l /usr/local/bin/awslrwxrwxrwx 1 ec2-user ec2-user 49 Oct 22 09:49 /usr/local/bin/aws ->/usr/local/aws-cli/v2/current/bin/aws
-
-
Confirm the installation with the following command.
$aws --versionaws-cli/2.17.20 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/2.4.5If the
awscommand cannot be found, you might need to restart your terminal or follow the troubleshooting in Troubleshoot AWS CLI errors.
(Optional) Verifying the integrity of your downloaded zip file
If you chose to manually download the AWS CLI version 2 installer package
.zip in the above steps, you use can use the following
steps to verify the signatures by using the GnuPG tool.
The AWS CLI version 2 installer package .zip files are
cryptographically signed using PGP signatures. If there is any damage or
alteration of the files, this verification fails and you should not proceed with
installation.
-
Download and install the
gpgcommand using your package manager. For more information aboutGnuPG, see the GnuPG website. -
To create the public key file, create a text file and paste in the following text.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cX7XnZbSqgJhUk9H324mIJiSwzvw1Ker6xtH/LwdBeJCck bVBdh3LZis4zuD4IZeBO1vRvjot3Oq4xadUv5RSPATg7T1kivrtLCnwvqc6L4LnF 0OkNysk94L3LQSHyQW2kQS1cVwr+yGUSiSp+VvMbAobAapmMJWP6e/dKyAUGIX6+ 2waLdbBs2U7MXznx/2ayCLPH7qCY9cenbdj5JhG9ibVvFWqqhSo22B/URQE/CMrG +3xXwtHEBoMyWEATr1tWwn2yyQGbkUGANneSDFiTFeoQvKNyyCFTFO1F2XKCcuDs 19nj34PE2TJilTG2QRlMr4D0NgwLLAMg2Los1CK6nXWnImYHKuaKS9LVaCoC8vu7 IRBik1NX6SjrQnftk0M9dY+s0ZbAN1gbdjZ8H3qlbl/4TxMdr87m8LP4FZIIo261 Eycv34pVkCePZiP+dgamEiQJ7IL4ZArio9mv6HbDGV6mLY45+l6/0EzCwkI5IyIf BfWC9s/USgxchg== =ptgS -----END PGP PUBLIC KEY BLOCK-----For reference, the following are the details of the public key.
Key ID: A6310ACC4672 Type: RSA Size: 4096/4096 Created: 2019-09-18 Expires: 2025-07-24 User ID: AWS CLI Team <aws-cli@amazon.com> Key fingerprint: FB5D B77F D5C1 18B8 0511 ADA8 A631 0ACC 4672 475C -
Import the AWS CLI public key with the following command, substituting
public-key-file-namewith the file name of the public key you created.$gpg --importpublic-key-file-namegpg: /home/username/.gnupg/trustdb.gpg: trustdb created gpg: key A6310ACC4672475C: public key "AWS CLI Team <aws-cli@amazon.com>" imported gpg: Total number processed: 1 gpg: imported: 1 -
Download the AWS CLI signature file for the package you downloaded. It has the same path and name as the
.zipfile it corresponds to, but has the extension.sig. In the following examples, we save it to the current directory as a file namedawscliv2.sig. -
Verify the signature, passing both the downloaded
.sigand.zipfile names as parameters to thegpgcommand.$gpg --verify awscliv2.sig awscliv2.zipThe output should look similar to the following.
gpg: Signature made Mon Nov 4 19:00:01 2019 PST gpg: using RSA key FB5D B77F D5C1 18B8 0511 ADA8 A631 0ACC 4672 475C gpg: Good signature from "AWS CLI Team <aws-cli@amazon.com>" [unknown] gpg: WARNING: This key is not certified with a trusted signature! gpg: There is no indication that the signature belongs to the owner. Primary key fingerprint: FB5D B77F D5C1 18B8 0511 ADA8 A631 0ACC 4672 475CImportant
The warning in the output is expected and doesn't indicate a problem. It occurs because there isn't a chain of trust between your personal PGP key (if you have one) and the AWS CLI PGP key. For more information, see Web of trust
.
Installation requirements
-
You know which release of the AWS CLI version 2 you'd like to install. For a list of versions, see the AWS CLI version 2 Changelog
on GitHub. -
We support the AWS CLI version 2 on Apple-supported versions of 64-bit macOS.
-
Because AWS doesn't maintain third-party repositories, we canβt guarantee that they contain the latest version of the AWS CLI.
Installation instructions
You can install the AWS CLI version 2 on macOS in the following ways.
Installation requirements
-
You know which release of the AWS CLI version 2 you'd like to install. For a list of versions, see the AWS CLI version 2 Changelog
on GitHub. -
We support the AWS CLI on Microsoft-supported versions of 64-bit Windows.
-
Admin rights to install software
Installation instructions
To update your current installation of AWS CLI version 2 on Windows, download a new
installer each time you update to overwrite previous versions. AWS CLI is updated
regularly. To see when the latest version was released, see the AWS CLI version 2
Changelog
-
Download and run the AWS CLI MSI installer for Windows (64-bit) in one of the following ways:
-
Downloading and running the MSI installer: To create your download link for a specific version of the AWS CLI, append a hyphen and the version number to the filename.
https://awscli.amazonaws.com/AWSCLIV2-version.number.msiFor this example the filename for version
2.0.30would beAWSCLIV2-2.0.30.msiresulting in the following link: https://awscli.amazonaws.com/AWSCLIV2-2.0.30.msi. -
Using the msiexec command: Alternatively, you can use the MSI installer by adding the link to the
msiexeccommand. For a specific version of the AWS CLI, append a hyphen and the version number to the filename.C:\>msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2-version.number.msiFor this example the filename for version
2.0.30would beAWSCLIV2-2.0.30.msiresulting in the following link https://awscli.amazonaws.com/AWSCLIV2-2.0.30.msi. C:\>msiexec.exe /i https://awscli.amazonaws.com/AWSCLIV2-2.0.30.msiFor various parameters that can be used with
msiexec, see msiexecon the Microsoft Docs website.
For a list of versions, see the AWS CLI version 2 Changelog
on GitHub. -
-
To confirm the installation, open the Start menu, search for
cmdto open a command prompt window, and at the command prompt use theaws --versioncommand.C:\>aws --versionaws-cli/2.17.20 Python/3.11.6 Windows/10 exe/AMD64 prompt/offIf Windows is unable to find the program, you might need to close and reopen the command prompt window to refresh the path, or follow the troubleshooting in Troubleshoot AWS CLI errors.
Troubleshooting AWS CLI install and uninstall errors
If you come across issues after installing or uninstalling the AWS CLI, see Troubleshoot AWS CLI errors for troubleshooting steps. For the most relevant troubleshooting steps, see Command not found errors, The "aws --version" command returns a different version than you installed, and The "aws --version" command returns a version after uninstalling the AWS CLI.
Next steps
After completing the steps in Prerequisites to use the AWS CLI version 2 and installing the AWS CLI, you should perform a Set up the AWS CLI.

