How to uninstall aws-cli

大憨熊 提交于 2019-12-04 17:32:33

问题


I am trying to set up an "Amazon Elastic Container Registry" but I get the following error when using this command: aws ecr get-login --no-include-email --region us-west-2:

Unknown options: --no-include-email

The manual redirects me when this occurs to go to the following page, in order to update my aws cli. https://docs.aws.amazon.com/cli/latest/userguide/installing.html

Which in short means, call pip install awscli --upgrade --user. While that works, my cli is not updated. So I removed it at all pip uninstall awscli. But I still had the aws command available, also when I opened a new session in the terminal...

So I assume I haven't installed my aws cli via pip, but I can not figure out how it does is installed. Can anyone help me out and give me some directions to resolve this issue. So I can remove the current awscli, and install a new version via pip install awscli --upgrade --user


回答1:


I had a similar issue. Answering in case someone else does too. I think I had originally installed it without pip like this: https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-bundle.html. So you just need to uninstall it like this (as instructed in above link):

$ sudo rm -rf /usr/local/aws
$ sudo rm /usr/local/bin/aws

Then you can re-install it with pip3: https://docs.aws.amazon.com/cli/latest/userguide/cli-install-macos.html

Basically:

pip3 install awscli --upgrade --user

Then add it to your path

export PATH=/Users/yourname/Library/Python/3.6/bin/:$PATH



回答2:


On ubuntu :

sudo apt-get remove --auto-remove awscli

ln -s /home/ubuntu/.local/bin/aws /usr/bin/aws



回答3:


I had the same issue, but unlike Morgan, I prefer to use Homebrew to maintain all my dependencies in a single place.

So what I did was:

1 - uninstall awscli (was installed with pip - python2)

$ sudo rm -rf /usr/local/aws
$ sudo rm /usr/local/bin/aws

2 - Install awscli using homebrew

$ brew install awscli

Homebrew will install awscli inside Cellar folder: /usr/local/Cellar/awscli

Note: I also have python3 installed through Hombrew.

Links:

  • Amazon-awscli: Amazon Install awscli

  • Homebrew-awscli: Homebrew Install awscli

  • Homebrew-python3: Homebrew Install python3




回答4:


Uninstall awscli.
pip uninstall awscli -y



来源:https://stackoverflow.com/questions/48572523/how-to-uninstall-aws-cli

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!