aws-cli icon indicating copy to clipboard operation
aws-cli copied to clipboard

V2 Update leaves old versions behind

Open tmccombs opened this issue 4 years ago • 2 comments

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug When I update the aws-cli v2 on linux, using the instructions here, it doesn't remove old versions of the awscli. So after several updates I end up with gigabytes of space used by old versions of aws-cli.

Platform/OS/Hardware/Device Linux

To Reproduce (observed behavior) Follow instructions at https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html#cliv2-linux-upgrade to upgrade aws-cli to a new version. Then inspect the folder where the aws-cli is installed, and see old versions still there.

Expected behavior Upgrading aws-cli shouldn't leave behind old versions.

Or better yet, provide ways to install aws-cli v2 using actual package managers like apt, dnf, maybe PyPi (see #4947) that handles cleaning up old files on upgrade.

tmccombs avatar Feb 25 '21 17:02 tmccombs

Hi @tmccombs,

Thanks for the report. This was intentional, as the idea was that you may want to use a previous version of the AWS CLI v2 without having to reinstall. The documentation should be more clear about the existing behavior, how you would easily switch versions, and how to remove one completely.

Please stay tuned on issue #4947, and see the recent update posted today:

https://github.com/aws/aws-cli/issues/4947#issuecomment-786937377

kdaily avatar Feb 26 '21 23:02 kdaily

Hi @tmccombs,

Thanks for the report. This was intentional, as the idea was that you may want to use a previous version of the AWS CLI v2 without having to reinstall. The documentation should be more clear about the existing behavior, how you would easily switch versions, and how to remove one completely.

Please stay tuned on issue #4947, and see the recent update posted today:

#4947 (comment)

Hi @kdaily can you please point me to where in the docs it outlines deleting previous unused versions? Our servers periodically fill up with like 100GB of all the various versions of AWS-CLI that are released over the course of a year (250MB per instance, 400 copies etc...)

I am content to write my own cron script to rm -rf every folder in there that isn't current or the latest numbered version but hoping there is some in-built functionality for this I'm failing to find?

jamaalsawyerd avatar Nov 24 '25 17:11 jamaalsawyerd