Next: CLI Version 1, Up: Installing the CLI [Index]
AWS CLI version 2 is provided as a preview for testing and evaluation. At this time, we do not recommend using it in a production environment. For production environments, we recommend that you use the generally available version 1.x.
AWS CLI version 2 is the most recent major version of the AWS CLI and supports all of the latest features. Some features introduced in version 2 are not backward compatible with version 1 and you must upgrade to access those features.
AWS CLI version 2 is available to install only as a bundled installer. Although you might find it in some package managers, these are not produced or managed by AWS and are therefore not official and not supported by AWS. We recommend that you install the AWS CLI from only the official AWS distribution points, as documented in this guide.
For AWS CLI version 2, it doesn’t matter if you have Python installed and if you do, it doesn’t matter which version. AWS CLI version 2 uses only the version of Python (and all other dependencies) that are included and installed into a local virtual environment that is isolated.
Follow these steps from the command line to install the AWS CLI on either Linux or macOS. The only difference in the following commands is the name of the file that you download. Everything else is the same.
curl "https://d1vvhvl2y92vvt.cloudfront.net/awscli-exe-macos.zip" -o "awscliv2.zip" unzip awscliv2.zip sudo ./aws/install aws2 --version
aws-cli/2.0.0dev2 Python/3.7.4 Darwin/18.7.0 botocore/2.0.0dev1
To upgrade your copy of the AWS CLI version 2, run the same steps that you used to install it, but this time include the --update or -u2 option on the install command line. If the installer finds an existing version of the AWS CLI version 2 in the target installation folder and the texinfo:@option{–upgrade}@@ option isn’t used, the install fails.
sudo ./aws/install --bin-dir /usr/local/bin --install-dir /usr/local/aws-cli --update
To uninstall the AWS CLI version 2, run the following commands, substituting the paths you used to install.
Now delete the two symlinks in the --bin-dir folder. If
your user account has write permission to these folders, you don’t need to use
sudo
.
sudo rm /usr/local/bin/aws2 sudo rm /usr/local/bin/aws2_completer
Finally, you can delete the --install-dir folder. Again,
if your user account has write permission to this folder, you don’t need to use
sudo
.
$ sudo rm -rf /usr/local/aws-cli
Next: CLI Version 1, Up: Installing the CLI [Index]