Ubuntu

如何在 Ubuntu 18.04 上安裝 awscli?

  • May 4, 2020

這應該是微不足道的,但似乎並非如此。我格式化了我的comp並安裝了conda(我習慣了這個打包工具)

pip install awscli --upgrade --user
Requirement already up-to-date: awscli in ./.local/lib/python3.7/site-packages (1.16.313)

但現在我有問題

aws --version

Command 'aws' not found, but can be installed with:

sudo snap install aws-cli  # version 1.16.266, or
sudo apt  install awscli 

我試過

sudo apt  install awscli
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package awscli is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'awscli' has no installation candidate

我更新併升級了我的發行版,所以我看不到任何問題。如何解決這個問題?

快速安裝

error: This revision of snap "aws-cli" was published using classic confinement
      and thus may perform arbitrary system changes outside of the security
      sandbox that snaps are usually confined to, which may put your system at
      risk.

      If you understand and want to proceed repeat the command including
      --classic.

這工作正常

sudo snap install aws-cli --classic

aws --version
aws-cli/1.16.266 Python/3.5.2 Linux/5.0.0-37-generic botocore/1.13.2

請改用以下步驟:

sudo apt-get update
sudo apt-get install awscli

aws --version

引用自:https://unix.stackexchange.com/questions/561236