You see a post or tweet and the author is talking about this really cool program they discovered. You find out the program can be installed via Homebrew,1 so you add it to your 'Putzing Project List'.2
When you get time to work on your project, you fire your computer to install the package and get this:
Thankfully there is a way to manually download the package and have Homebrew use the local file to install the program.
Manual Brew Install
When you install a program with Homebrew it will download an archive file (gzip, bz2, tar, etc.) of the package to your computer first. Normally this happens automagically with the Homebrew install process, but sometimes you'll run into a problem with the default URL. Here's a work around on how to install a package with a manually downloaded archive file.
- Locate the project homepage for the program you're trying to install. Typically you'll be able to go back to the URL listed when the install failed. In my example I went back to http://wiki.qemu-project.org to find the archive package file.
- Check to see if you can download the package from your browser from the primary repository. Make sure you're downloading the same version that Homebrew believes it should install, even if there is a new version. Leave this file to your
Downloadsfolder for now.
- Sometimes you hit an outage (e.g. maintenance schedule) for the main repository. If you can't download the archive file from the main source, double check if there is a mirror and grab the archive file from there. Again, make sure you grab the same version that Homebrew wants to install.
- Determine where Homebrew would normally download the archive file to, so you know where to put the manually downloaded file. Open a Terminal window and enter
brew --cache. This will give a path on where the archive file would normally be saved to before getting installed. In my case the path is
- Copy/move the archive file from
Downloadsto the folder path you found with the
- Re-run the Homebrew install command -
brew install qemu. Homebrew will notice you already have the file downloaded and run the rest of the install process using the local file.
Boom! The program installs and you're ready to work on your new project. If you run into any problems, double check for any dependencies that aren't being met or specific errors when Homebrew was trying to compile the package.
Beyond that... Google is your new friend for an answer.
FWIW: The qemu package I was trying to install is a processor emulator I want to use to a version of Raspian Linux on my Mac. This way I can test Raspberry Pi projects when I'm away from my home work bench.