According to this:
Not really without modifying the formula file.
if your local archive is pre-build file, aka 'bottle' in Brew.
Here is what I dig out:
The brew bottle is MacOS version-related.
Take pkg-config for example.
here on https://bintray.com/homebrew/bottles/pkg-config#files/, it lists different files for different MacOS version.
After downloading the correct file, you need to move it to correct path which can be generated by
brew --cache --force-bottle pkg-config
for 10.14: it's like:
/Users/username/Library/Caches/Homebrew/downloads/dd6c78ec64b7c09961ccdb1bf873b5852fd93783cf25ae9b9399c5896a420462--pkg-config-0.29.2.mojave.bottle.tar.gz
for 10.13: it's like:
/Users/username/Library/Caches/Homebrew/downloads/8b865a8ad8179d4a45289cab9267cc5e3a6153d06432d90cf1745caf5d92a64d--pkg-config-0.29.2.high_sierra.bottle.tar.gz
after that, brew can find the cached local file when you run brew install pkg-config
. otherwise, it will still download from a URL.
just move file to $(brew --cache) won't work anymore, at least for today's brew( 2.19 version in my case).
brew doctor
?brew install
. But this is mysterious. How about posting the output ofbrew install
when you try it the normal way?