Using Homebrew How Do I Remove Some Specific Versions but Not All Old Versions

Using Homebrew's brew command, I would like to remove some specific versions of a formula and keep others.

I know that I can use brew cleanup to remove all old versions but this isn't exactly what I want. Cleanup will remove all the old versions, but I wish to keep one of them.

To be specific, I have the following versions of a package installed: * 2.10.3 * 2.10.4 * 2.11.0 * 2.11.1

I would like to keep the current version, right now that's 2.11.1 and also keep version 2.10.4. I would like to remove the other versions, 2.11.0 and 2.10.3.

1

2 Answers

To remove all old versions:

brew cleanup

To remove old version of X package:

brew cleanup X
2

You can just rm -rf them from the Cellar.

4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest