Install, Update, and Uninstall the Amazon CLI version 1 on Amazon Linux - Amazon Command Line Interface
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

This documentation is for Version 1 of the Amazon CLI only. For documentation related to Version 2 of the Amazon CLI, see the Version 2 User Guide.

Install, Update, and Uninstall the Amazon CLI version 1 on Amazon Linux

The Amazon CLI version 1 is preinstalled on Amazon Linux and Amazon Linux 2. Check the currently installed version by using the following command.

$ aws --version aws-cli/1.32.65 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/1.18.6

Depending on when you created your Amazon Linux instance, the Amazon CLI version 1 is preinstalled using one of the following package managers:

Prerequisites

You must have Python 3.8 or later installed. For installation instructions, see the Downloading Python page in Python's Beginner Guide.

Python version support matrix
Amazon CLI version Supported Python version
1.32.0 – current Python 3.8+
1.27.0 – 1.31.x Python 3.7+
1.20.0 – 1.26.x Python 3.6+
1.19.0 – 1.19.x Python 2.7+, Python 3.6+
1.17 – 1.18.x Python 2.7+, Python 3.4+
1.0 – 1.16.x Python 2.6 and older, Python 3.3 and older

Install, update, or uninstall using pip

Most Amazon Linux instances use pip to preinstall the Amazon CLI version 1.

Install or update the Amazon CLI version 1 on Amazon Linux using pip

To install the latest version of the Amazon CLI version 1 for the current user, use the following instructions.

  1. We recommend that if you have Python version 3 or later installed that you use pip3. Use pip3 install to install or update to the latest version of the Amazon CLI version 1. If you run the command from within a Python virtual environment (venv), you don't need to use the --user option.

    $ pip3 install --upgrade --user awscli
  2. Ensure the folder that contains aws is part of your PATH variable.

    1. Find your shell's profile script in your user directory. If you're not sure which shell you have, run echo $SHELL.

      $ ls -a ~ . .. .bash_logout .bash_profile .bashrc Desktop Documents Downloads
      • Bash.bash_profile, .profile, or .bash_login

      • Zsh.zshrc

      • Tcsh.tcshrc, .cshrc or .login

    2. Add an export command at the end of your profile script that's similar to the following example.

      export PATH=$HOME/.local/bin:$PATH

      This command inserts the path, $HOME/.local/bin in this example, at the front of the existing $PATHvariable.

    3. Reload the profile into your current session to put those changes into effect.

      $ source ~/.bash_profile
  3. To verify that you're running the new version, use the aws --version command.

    $ aws --version aws-cli/1.32.65 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/1.18.6

Uninstall the Amazon CLI version 1 using pip

If you need to uninstall the Amazon CLI, use pip uninstall.

$ pip3 uninstall awscli

Install, update, or uninstall using yum

Most Amazon Linux 2 instances use yum to preinstall the Amazon CLI version 1.

Install or update the Amazon CLI version 1 on Amazon Linux using yum

To install the latest version of the Amazon CLI version 1 available on Amazon Linux, run the following command.

$ sudo yum install awscli

To update to the latest version of the Amazon CLI version 1 available on Amazon Linux, run the following command.

$ sudo yum update awscli

To verify that you're running the newer version, use the aws --version command.

$ aws --version aws-cli/1.32.65 Python/3.11.6 Linux/5.10.205-195.807.amzn2.x86_64 botocore/1.18.6

Uninstall the Amazon CLI version 1 using yum

To uninstall the Amazon CLI, use yum remove.

$ sudo yum remove awscli

Troubleshooting Amazon CLI install and uninstall errors

If you come across issues after installing or uninstalling the Amazon CLI, see Troubleshoot Amazon 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 Amazon CLI.