Apple - How to use Homebrew to install local archive

If Homebrew already has a formula for it (in /usr/local/Library/Formula), and you have the exact archive that the formula expects (i.e. same file name and same contents, as determined by SHA1 or whatever hash type the formula uses), you can put the archive in ~/Library/Caches/Homebrew and then try brew install formula_name (substituting the correct name for formula_name, of course).


$ brew install -f wget-1.14.tar.gz

It is possible to pre-download a file for a formula but you will need correct cache file name which can be generated using brew --cache -s <formula>.

For example, for Erlang formula, brew --cache -s erlang will print the correct name of the cached download. This means instead of manually renaming a formula, you can run:

wget source-version.tar.gz
mv source-version.tar.gz $(brew --cache -s <formula>)

Tags:

Macos

Homebrew