How to upgrade AWS CLI to the latest version?

前端 未结 12 2328
走了就别回头了
走了就别回头了 2020-12-07 14:41

I recently noticed that I am running an old version of AWS CLI that is lacking some functionality I need:

$aws --version
aws-cli/1.2.9 Python/3.4.3 Linux/3.1         


        
相关标签:
12条回答
  • 2020-12-07 14:52

    On Linux and MacOS X, here are the three commands that correspond to each step:

    $ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
    $ unzip awscli-bundle.zip
    $ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
    
    0 讨论(0)
  • 2020-12-07 14:53

    This does not work:

    pip install --upgrade awscli

    This worked fine on Ubuntu 14.04( no need to reboot also .. You would have to first install pip3 ):

    pip3 install --upgrade awscli

    0 讨论(0)
  • 2020-12-07 14:56
    pip install awscli --upgrade --user
    

    The --upgrade option tells pip to upgrade any requirements that are already installed. The --user option tells pip to install the program to a subdirectory of your user directory to avoid modifying libraries used by your operating system.

    0 讨论(0)
  • 2020-12-07 15:03

    Try sudo pip install --upgrade awscli, and open a new shell. This worked well for me (no need to reboot).

    0 讨论(0)
  • 2020-12-07 15:06

    From http://docs.aws.amazon.com/cli/latest/userguide/installing.html#install-with-pip

    To upgrade an existing AWS CLI installation, use the --upgrade option:

    pip install --upgrade awscli
    
    0 讨论(0)
  • If you are having trouble installing the AWS CLI using pip you can use the "Bundled Installer" as documented here.

    The steps discussed there are as follows:

    $ curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
    $ unzip awscli-bundle.zip
    $ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
    

    Check your AWS CLI version subsequently as a sanity-check that everything executed correctly:

    $ aws --version
    

    If the AWS CLI didn't update to the latest version as expected maybe the AWS CLI binaries are located somewhere else as the previously-given commands assume.

    Determine where AWS CLI is being executed from:

    $ which aws
    

    In my case, AWS CLI was being executed from /bin/aws, so I had to install the "Bundled Installer" using that location as follows:

    $ sudo ./awscli-bundle/install -i /user/local/aws -b /bin/aws
    
    0 讨论(0)
提交回复
热议问题