Or update if you already have. $ brew update && brew upgrade. Install Git with Homebrew. $ brew install git. $ brew link -force git. Close Terminal and reopen then check version. $ git -version.
I need a newer version of gcc to compile libgimli (http://sourceforge.net/projects/libgimli/) under mac os x 10.7.4. I already tried macports, homebrew and compiling from hand, but I keep getting errors. Below is the error if I use Homebrew. How should I proceed?
How to Update Homebrew on Mac. Want to update Homebrew and your packages? Of course you do! Homebrew is a popular package manager for Mac that easily allows users to install and manage command line tools, apps, and utilities, typically familiar with the Linux and Unix world. How to upgrade Git on Mac (OSX) Recently a vulnerability in Git was discovered that could lead to arbitrary code execution when a developer utilizes a malicious repository. The good news is that this issue has been patched and the fix is available in version 2.17.1. Run brew update && brew upgrade every once in a while (and you can do it after upgrading macOS). Brew update will update the list of available formulae, and brew upgrade will upgrade any outdated packages. If you like, everything can be scripted as well: Run the macOS installer: startosinstall; Run all macOS updates for Xcode, etc. Next, upgrade PHP: brew upgrade php. Check the current version by running php -v: php -v. Restart Nginx or Apache: sudo nginx -s reload. Sudo apachectl restart. And make sure that your local web server also uses PHP 7.4 by visiting this script.
hecking for x86_64-apple-darwin11.4.0-gcc... /private/tmp/homebrew-gcc-4.7.0-OLFi/gcc-4.7.0/build/./gcc/xgcc -B/private/tmp/homebrew-gcc-4.7.0-OLFi/gcc-4.7.0/build/./gcc/ -B/usr/local/Cellar/gcc/4.7.0/gcc/x86_64-apple-darwin11.4.0/bin/ -B/usr/local/Cellar/gcc/4.7.0/gcc/x86_64-apple-darwin11.4.0/lib/ -isystem /usr/local/Cellar/gcc/4.7.0/gcc/x86_64-apple-darwin11.4.0/include -isystem /usr/local/Cellar/gcc/4.7.0/gcc/x86_64-apple-darwin11.4.0/sys-include
checking for suffix of object files... configure: error: in `/private/tmp/homebrew-gcc-4.7.0-OLFi/gcc-4.7.0/build/x86_64-apple-darwin11.4.0 /libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
make: *** [configure-stage1-target-libgcc] Error 1
make: *** [stage1-bubble] Error 2
make: *** [bootstrap] Error 2
> Build Environment
CPU: quad-core 64-bit sandybridge
'--use-clang' was specified
CXX: /usr/bin/clang++ => /usr/bin/clang
CFLAGS: -Os -w -pipe -march=native -Qunused-arguments -m64
CXXFLAGS: -Os -w -pipe -march=native -Qunused-arguments -m64 -U_GLIBCXX_DEBUG -U_GLIBCXX_DEBUG_PEDANTIC
LDFLAGS: -arch x86_64
Error: Failed executing: make bootstrap (.rb:)
If `brew doctor' does not help diagnose the issue, please report the bug:
MacBook Pro, Mac OS X (10.7.4)
Posted on Jun 6, 2012 5:14 AM
How to install brew packages based on XCode, Ruby, Homebrew
- Install Homebrew
This tutorial provides a deep dive of Homebrew,a package manager for Mac OSX (MacOS)that’s like other package mangers for Linux:
|Distribution||Package Manager||Format||GUI tools|
|Debian, Ubuntu||dpkg||.deb||APT (Advanced Packaging Tool)|
|RedHat, Fedora, openSUSE||RPM||.rpm||Yum, apt4rpm, up2date, urpmi, ZYpp, poldek|
|Arch Linux, Frugalware, DeLi Linux||Pacman||-||-|
Step-by-step instructions are provided here to install Homebrew itselfand then install Homebrew packages based on the name of formulae specified for installationin a command such as:
brew install wget
DEFINITION: A formula provides instructions on how to install packages andtheir dependencies, such as where to find tar.gzip files for download.
Brew installs packages in its own Cellar directory (folder)and adds symlinks to the /usr/local folder.
Homebrew is the newest and most popular package utility on OSX.
Homebrew’s web page is at http://brew.sh
Alternatives to Homebrew
Preparations: XCode CLI
Make a full backup of your system right before following these instructions.
Open the App Store to install XCode, Apple’s IDE for developing Swift and Objective-C to run on iPhones and iPads.
PROTIP: Apple’s App Store only installs .app files. So programs invoked from the command line Terminal (such as gcc) need to be installed a different way.
To verify XCode CLI install:
This message means that it’s not installed:
Open a Terminal to install XCode CLI:
If XCode is not already installed, you are prompted to install it:
Installation is to folder: /Library/Developer/CommandLineTools/.
Homebrew requires OS X 10.5+ and the Xcode command line tools.
To download the Command Line Utilities, go to https://developer.apple.com/download/more/and look for your version of “Command Line Tools (macOS 10.14) for XCode 10”, one that doesn’t say “beta”.
Since the El Capitan version of Mac OSX, file permissions in /usr/local have changed,causing error messages such as:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
So in a Terminal shell window at any folder:
sudo chown -R :staff /usr/local
Verify installation by getting the version of the GNU Compiler Collection:
You should see something like this (for Mojave):
Homebrew makes use of Ruby, which comes with macOS.
Install Homebrew if you haven’t already.
CAUTION: Don’t press Enter on the Terminal until the Download Software dialog reaches 100%.
Press the Enter key to the message:
Press RETURN to continue or any other key to abort. then
To proceed, enter the root password, or type Ctrl+C to abort.
NOTE: The download is from
HISTORICAL NOTE: Previously, the Homebrew installer was at
Identify where the Homebrew program itself is located:
The response is the brew executable program at:
The “brew” above is a shell script file.
PROTIP: The “/usr/local” is the default specified by the $HOMEBREW_PREFIX environment variable.
Identify where the Homebrew program stores packages:
Update Homebrew itself
Get Homebrew version:
The response (at time of writing):
NOTE: Homebrew is open-sourced at
To update Homebrew itself and its formulas:
Yes, run it twice to make sure all dependencies took.
Each run can take several minutes.
Search for a formula to install
Use an internet browser (such as Google Chrome)to view formula defined in
http://braumeister.org provides recent activity.
Install the wget command-line utility by formula name (for example, wget):
brew install wget
This installs to folder /usr/local/bin/wget.
See Tips & Tricks on how to use proxy, remove the beer mug emoji, highlighting within editors, etc.
Get a count of kegs, how many files, and the disk space they take:
A sample response:
Where did it go?
List where .tar.gz “bottle” files are downloaded into from the internet:
DEFINITION: A “Bottle” is a pre-built binary Keg used for installation instead of building from source.It can be unpacked.
The response includes your user name, which enablesHomebrew to work without using sudo (elevation to root).
The equivalent of the above is:
List bottles downloaded:
Examples of responses:
List brew formulas installed:
The alternative commands above all do the same thing of the same folder,for example:
There is no response if no brew package has been installed.
See one level below one of the above folders for a specific formula,such as openssl:
It is usually a version number, such as:
DEFINITION: A “Keg” is the installation prefix of a formula, such as:
List brew package .rb (Ruby language) files installed:
The response is a long list.
List brew package folders:
The response is a long list.
Different ways to install weget.
The above is one of several ways to install the wget command-line utility.
One way is to install Apple’s Xcode.
Test wget operating:
Verify brew installation:
If you see this message at the top of messages returned:
The above may occur if curl and nodejs were installed without using homebrew.
Remove them before installing node and curl using Homebrew:
Create symlinks to installations performed manually in Cellar. This allows you to have the flexibility to install things on your own but still have those participate as dependencies in homebrew formulas.
First, see what exactly will be overwritten, without actually doing it:
The response is:
“Keg-only” refers to a formula installed only into the Cellar and not linked into /usr/local, which means most tools will not find it. This is to avoid conflicting with the system version of the same package.
Alternately, if aswcli is specified for dry-run, the response is:
NOTE: Homebrew installs to the Cellar it then symlinks some of the installation into /usr/local so that other programs can see what’s going on.
A symlink to the active version of a Keg is called an “opt prefix”.
List where a link goes:
ls -l $(which wget)
If you see this message:
A sample response:
List formula (package definitions):
brew edit $FORMULA
The above command brings you to your default text editor (vim or whatever is specified in the $EDITOR variable).
Type :q to quit out.
Brew Update Maven
Upgrade brew formulas
List brew packages that are obsolete:
To stop a specific package from being updated/upgraded,pin it:
brew pin $FORMULA
$FORMULA is ???
To allow that formulae to update again, unpin it.
Download and update ALL software packages installed:
To see which files would be removed as no longer needed:
brew cleanup -n
No response if there is nothing to clean. Otherwise, example:
To really remove all files no longer needed:
A sample response:
PROTIP: Before deleting, identify its dependencies. For example:Two delete commands does the same: Additional flags: `–force` or `-f` forcibly removes all versions of that package. `–ignore-dependencies` ignore dependencies for the formula when uninstalling the designated package, which may cause other brews to no longer work correctly.## Tap #Brew tap adds repos not in the Homebrew master repofrom inside a larger package.https://github.com/Homebrew/brew/blob/master/docs/brew-tap.mdsays tap adds to the list of formulae that brew tracks, updates, and installs from.0. List brew tap packages already installed: 0. Install the ip tool included with iproute2 on Linux: The command specififies the account and repo in GitHub, as in
https://github.com/brona/iproute2mac or https://superuser.com/questions/687310/ip-command-in-mac-os-x-terminal 0. Try it (instead of ifconfig): 0. Remove a tap: ## brew install --cask #Homebrew cask extends homebrew and brings its elegance, simplicity, and speed to MacOS (OS X) GUI applications and large binaries.https://caskroom.github.ioWith Cask, you can skip the long URLs, the 'To install, drag this icon…', and manually deleting installer files.0. Temporarily set the permissions on /usr/local: 0. Install brew cask: Applications are kept in their Caskroom under /opt and symblinked to $HOME/Applications from https://github.com/caskroom/homebrew-cask0. https://caskroom.github.io, the home page, said there are 3,197 casks as of June 5, 2016. QUESTION: Is there a graph of growth in cask counts over time?0. Install the cask extension to Homebrew: Alternately: 0. Search for a cask by name, in website is where casks are obtained: https://github.com/caskroom/homebrew-cask/search?utf8=✓ Alternately, run a search command. This example searches for 'yo': PROTIP: One should see the cask definition before using it. I would be suspicious of casks with sparse information. The safe way to get the homepage URL of the programmer is from here (don't Google it and end up at a rogue site).0. Look at some cask definitions: https://github.com/caskroom/homebrew-cask/blob/master/Casks/google-chrome.rb is a sample cask definition:0. Install the cask:
Macos Brew Update Hangsbrew install --cask google-chrome Cask downloads then moves the app to the ~/Applications folder, so it can be opened this way:0. Open the installed cask from Terminal: 0. Installing with cask enables you to cleanup: ### Error prevention If you get an error about 'permissions denied':0. Create a Caskroom folder 0. Edit the .bash_profile 0. Add this line: QUESTION: The use of --caskroom is deprecated?0. Save the file.0. Restart the terminal. ## GUI for Homebrew packageshttps://www.cakebrew.com/ is a GUI to help manage Homebrew packages: ## Analytics offHomebrew now defaults to retrieving behavioral analytics tracking. Although anonymized, you may not want to participate in that. To disable the extra network traffic: ## Debian apt-getDownload Fink commander Fink Installer.pkg from
http://finkcommander.sourceforge.net/help/install.phpThis explains: Fink stores data in the directory “/sw” by default. This goes against the Filesystem Hierarchy Standard’s recommendation to use “/usr/local”. Within Fink’s directory, a FHS-like layout (/sw/bin, /sw/include, /sw/lib, etc.) is used.## Documentation #0. For more documentation on brew, look here and: man brew