How do I ensure that Homebrew uninstalls old versions when upgrading?

1

Homebrew seems to install new versions side by side with old versions when upgrading outdated versions (brew upgrade), at least I have a bunch of packages with multiple versions. How do I ensure that old versions are removed and not kept around when upgrading?

Is there support for auto-removal of outdated versions at all?

aknuds1

Posted 2015-09-20T18:34:27.617

Reputation: 8 668

Answers

3

brew cleanup is your friend for this. Check out the answer I gave in a related question here.

brew install in and of itself doesn't appear to have options for this. This might be a useful feature so I requested it from the publisher.

SaxDaddy

Posted 2015-09-20T18:34:27.617

Reputation: 3 181

I do know about cleanup; what I was really wondering is if brew can be made to remove outdated versions automatically when upgrading instead. – aknuds1 – 2015-09-21T11:17:56.033

install in and of itself doesn't appear to have options for this. This might be a useful feature to request. – SaxDaddy – 2015-09-22T21:07:49.200

I'd add that to your answer :) – aknuds1 – 2015-09-22T21:43:23.947

Ah cool, I see you updated the answer, thanks. – aknuds1 – 2015-09-25T04:56:23.710

@aknuds1, it appears that this has been implemented! Check out https://github.com/Homebrew/homebrew/pull/44305.

– SaxDaddy – 2015-09-30T00:17:41.703