Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to prevent Homebrew from installing a certain formula dependency?

Tags:

homebrew

How to prevent Homebrew from installing a certain dependency formula when installing any future formulae? On my mac, python is provided by conda and I don't want duplicate pythons. Every time I install a python-dependent formula it gets automatically installed.

like image 646
Eureka Zheng Avatar asked Mar 15 '19 21:03

Eureka Zheng


People also ask

How do I install a specific version of a package with brew?

If you can't use the web interface, you can clone the repo and do it locally: use git log master -- Formula/PACKAGENAME. rb to get the commit history, check out the correct commit, and then run brew install Formula/PACKAGENAME. rb to install it. I think you need brew unlink before brew install of other version.

Where are brew formulas installed?

Packages are installed according to their formulae, which live in /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula .

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> .


1 Answers

First, have a look the dependencies you need for the formula. (use brew deps --tree xpdf for a tree view)

brew deps -n formula
dep1
dep2

Then install the dependencies you want manually.

brew install dep1

And finally install the formula using --ignore-dependencies.

brew install --ignore-dependencies formula
like image 104
Pau Avatar answered Oct 22 '22 22:10

Pau