Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using Homebrew how do I remove some specific versions but not all old versions

Tags:

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.

like image 711
Carl Avatar asked May 30 '14 15:05

Carl


People also ask

What does brew Autoremove do?

The autoremove command removes all the hanging, no longer needed packages from your computer. So say goodbye to unneeded dependencies and messy brew list output.

What is keg only?

What does “keg-only” mean? It means the formula is installed only into the Cellar and is not linked into the default prefix. This means most tools will not find it. You can see why a formula was installed as keg-only, and instructions for including it in your PATH , by running brew info <formula> .


2 Answers

To remove all old versions:

brew cleanup 

To remove old version of X package:

brew cleanup X 
like image 95

You can just rm -rf them from the Cellar.

like image 35
mipadi Avatar answered Sep 22 '22 11:09

mipadi