Install the AWS Command Line Interface on Linux

You can install the AWS Command Line Interface and its dependencies on most Linux distributions with pip, a package manager for Python.

Important

The awscli package is available in repositories for other package managers such as APT and yum, but it is not guaranteed to be the latest version unless you get it from pip or use the bundled installer

If you already have pip, follow the instructions in the main installation topic. Run pip --version to see if your version of Linux already includes Python and pip.

$ pip --version

If you don't have pip, check to see which version of Python is installed.

$ python --version

or

$ python3 --version

If you don't have Python 2 version 2.6.5+ or Python 3 version 3.3+, install Python. Otherwise, install pip and the AWS CLI.

Installing Pip

If you don't have pip, install pip with the script provided by the Python Packaging Authority.

To install pip

  1. Download the installation script from pypa.io:

    $ curl -O https://bootstrap.pypa.io/get-pip.py

    The script downloads and installs the latest version of pip and another required package named setuptools.

  2. Run the script with Python:

    $ python get-pip.py --user
  3. Add the executable path to your PATH variable: ~/.local/bin

    To modify your PATH variable (Linux, macOS, or Unix)

    1. Find your shell's profile script in your user folder. If you are 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 to your profile script.

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

      This command adds a path, ~/.local/bin in this example, to the current PATH variable.

    3. Load the profile into your current session.

      $ source ~/.bash_profile
  4. Verify that pip is installed correctly.

    $ pip --version
    pip 8.1.2 from ~/.local/lib/python3.4/site-packages (python 3.4)

Installing the AWS CLI with Pip

Use pip to install the AWS CLI.

$ pip install awscli --upgrade --user

Verify that the AWS CLI installed correctly.

$ aws --version
aws-cli/1.11.84 Python/3.6.2 Linux/4.4.0-59-generic botocore/1.5.47

If you get an error, see Troubleshooting AWS CLI Errors.

To upgrade to the latest version, run the installation command again:

$ pip install awscli --upgrade --user

Adding the AWS CLI Executable to your Command Line Path

After installing with pip, you may need to add the aws executable to your OS's PATH environment variable.

Example AWS CLI install location - Linux with pip (user mode)

~/.local/bin

If you didn't install in user mode, the executable might be in the bin folder of your Python installation. If you don't know where Python is installed, run which python.

$ which python
/usr/local/bin/python

The output may be the path to a symlink, not the actual executable. Run ls -al to see where it points.

$ ls -al /usr/local/bin/python
~/.local/Python/3.6/bin/python3.6

To modify your PATH variable (Linux, macOS, or Unix)

  1. Find your shell's profile script in your user folder. If you are 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 to your profile script.

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

    This command adds a path, ~/.local/bin in this example, to the current PATH variable.

  3. Load the profile into your current session.

    $ source ~/.bash_profile

最新文章

  1. html传值 location.search取
  2. Ext3文件系统及JDB介绍
  3. DirectShowLib directshownet 视频
  4. js简单分页,可用
  5. 2016年11-29 mysql数据库
  6. javaSE第二十二天
  7. Java HashMap 源码解析
  8. Java基础知识强化31:String类之String的面试题
  9. 《SDN核心技术剖析和实战指南》第一章小结
  10. Raid1源代码分析--读流程
  11. 关于Adobe CC 系列软件反复弹出 Adobe 软件许可问题
  12. Struts标签库详解【3】
  13. 如何在Linux中使用命令行卸载软件
  14. c++sort函数的使用总结
  15. 使用Sphinx编写文档
  16. sql server 日志传送问题整理
  17. Java多层嵌套异常处理的基本流程
  18. hdu 1069 DAG加权
  19. cocos2dx 3.3多相机下_transformUpdated bug
  20. poj3207 Ikki's Story IV - Panda's Trick 2-SAT

热门文章

  1. Go语言使用百度翻译api
  2. python2.7练习小例子(五)
  3. Python的re模块的常用方法
  4. ACE学习综述(1)
  5. 梳理 Opengl ES 3.0 (一)宏观着眼
  6. spring与mybatis整合(基于配置文件)
  7. @section script{}的使用
  8. 福大软工1816:Alpha(1/10)
  9. MAC下Python3.5安装问题
  10. sc"