How to upgrade AWS CLI to the latest version?

前端 未结 12 2327
走了就别回头了
走了就别回头了 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:43

    When using sudo pip install --upgrade awscli I got the following error:

    ERROR: Could not install packages due to an EnvironmentError: [Errno 30] Read-only file system: '/lib'
    

    By using sudo with -H option, I could fix the problem.

    sudo -H pip install --upgrade awscli
    
    0 讨论(0)
  • 2020-12-07 14:44

    We can follow the below commands to install AWS CLI on UBUNTU:

    sudo apt install curl

    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

    rm -rf awscli-bundle.zip awscli-bundle

    To test: aws — version

    For More Info :

    https://gurudathbn.wordpress.com/2018/03/31/installing-aws-cli-on-ubuntu/

    0 讨论(0)
  • 2020-12-07 14:45

    Simple use sudo pip install awscli --force-reinstall --upgrade

    This will upgrade all the required modules.

    0 讨论(0)
  • 2020-12-07 14:46

    For Ubuntu 16.04 I used parts of the other answers and comments and just reloaded bash instead of rebooting.

    I installed the aws-cli using apt so I removed that first:

    sudo apt-get remove awscli
    

    Then I could pip install (I chose to use sudo to install globally with pip2):

    sudo pip install -U awscli
    

    Since I was doing this on a server I didn't want to reboot it, but reloading bash did the trick:

    source ~/.bashrc
    

    At this point I could use the new version of aws cli

    aws --version
    
    0 讨论(0)
  • 2020-12-07 14:47

    On Mac you can use homebrew:

    to install: brew install awscli

    to upgrade: brew upgrade awscli

    Make sure you don't have multiple installations: where aws

    0 讨论(0)
  • 2020-12-07 14:47

    Currently, using pip will get you the old version of awscli, 1.18.103.

    The latest version of aws-cli, 2.0.33 is on the v2 branch. You can download the installer for Linux, Windows and macOS from here.

    0 讨论(0)
提交回复
热议问题