aws-cli shows old version after upgrade

Question:

I am using raspberry which is running raspbian jessie OS.
I tried to install/upgrade the aws-cli using steps provided at https://aws.amazon.com/cli/
Even after upgrade was successful, I get below output

This was same before installation.
Drawbacks:
I am not able to see ‘iot’ as option when I run aws help. Majority of other services like ec2 & s3 are available

What can be the reason behind this behavior? How to solve this?

Answer:

Like me, your old version of the AWS CLI would have been installed via PIP (python package installer).

If you do which aws you will see something like so ...Python/2.7/bin/aws

You then tried to upgrade using the official AWS package installer – e.g. https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-mac.html#cliv2-mac-install-cmd

This method installs the new version in a location like /usr/local/bin/aws

So you basically have 2 versions of the AWS CLI on your system. When you do aws --version you are seeing the old PIP based installation.

To fix it (as I did) – I just used PIP to upgrade existing CLI:

Leave a Reply