Skip to content
asimihsan edited this page Oct 22, 2011 · 22 revisions

This is a list of commonly encountered problems, known issues, and their solutions.

brew update complains about untracked working tree files

After running brew update, you receive a git error warning about untracked files or local changes that would be overwritten by a checkout or merge, followed by a list of files inside your Homebrew installation.

This is caused by an old bug in in the update code that has long since been fixed. However, the nature of the bug requires that you do the following:

cd $(brew --prefix)
git reset --hard FETCH_HEAD

launchctl refuses to load launchd plist files

When trying to load a plist file into launchctl, you receive an error that resembles

Bug: launchctl.c:2325 (23930):13: (dbfd = open(g_job_overrides_db_path, [...]
launch_msg(): Socket is not connected

This is likely due to one of two issues. Either:

  1. You are using iTerm. The solution is to use Terminal.app when interacting with launchctl.
  2. You are attempting to run launchctl while logged in remotely. You should enable screen sharing on the remote machine and issue the command using Terminal.app running on that machine.

make complains that gcc-4.2 or g++-4.2 could not be found

When attempting to install many packages, for example libxml2 or nmap, the output indicates the following:

/bin/sh: /usr/bin/g++-4.2: No such file or directory

For example, below if the complete output from attempting to install nmap:

schopenhauer:~ maintenance$ brew install nmap
==> Downloading http://nmap.org/dist/nmap-5.51.tar.bz2
######################################################################## 100.0%
==> ./configure --prefix=/usr/local/Cellar/nmap/5.51 --without-zenmap
==> make
Makefile:375: makefile.dep: No such file or directory
/usr/bin/g++-4.2 -MM -I./liblua -I./libdnet-stripped/include -I./libpcre  -I./nbase -I./nsock/include -DHAVE_CONFIG_H -DNMAP_NAME=\"Nmap\" -DNMAP_URL=\"http://nmap.org\" -DNMAP_PLATFORM=\"x86_64-apple-darwin11.2.0\" -DNMAPDATADIR=\"/usr/local/Cellar/nmap/5.51/share/nmap\" -D_FORTIFY_SOURCE=2 main.cc nmap.cc targets.cc tcpip.cc nmap_error.cc utils.cc idle_scan.cc osscan.cc osscan2.cc output.cc payload.cc scan_engine.cc timing.cc charpool.cc services.cc protocols.cc nmap_rpc.cc portlist.cc NmapOps.cc TargetGroup.cc Target.cc FingerPrintResults.cc service_scan.cc NmapOutputTable.cc MACLookup.cc nmap_tty.cc nmap_dns.cc traceroute.cc portreasons.cc xml.cc nse_main.cc nse_utility.cc nse_nsock.cc nse_dnet.cc nse_fs.cc nse_nmaplib.cc nse_debug.cc nse_pcrelib.cc nse_binlib.cc nse_bit.cc nse_openssl.cc nse_ssl_cert.cc  > makefile.dep
/bin/sh: /usr/bin/g++-4.2: No such file or directory
make: *** [makefile.dep] Error 127
==> Exit Status: 2

If you do a list of files in /usr/bin/, you'll notice this:

schopenhauer:~ maintenance$ ls -ltra /usr/bin/gcc* /usr/bin/g++*
lrwxr-xr-x  1 root  wheel  12 Oct 19 06:54 /usr/bin/gcc -> llvm-gcc-4.2
lrwxr-xr-x  1 root  wheel  12 Oct 19 06:54 /usr/bin/g++ -> llvm-g++-4.2

I noticed this happened to me after upgrading from OS X 10.6 to OS X 10.7, and then upgrading from XCode 3 to XCode 4. The fix is to manually create the appropriate soft-links, i.e. to execute:

schopenhauer:~ maintenance$ sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2
schopenhauer:~ maintenance$ sudo ln -s /usr/bin/llvm-g++-4.2 /usr/bin/g++-4.2

After doing so the previous ls should output the following:


schopenhauer:~ maintenance$ ls -ltra /usr/bin/gcc* /usr/bin/g++*
lrwxr-xr-x  1 root  wheel  12 Oct 19 06:54 /usr/bin/gcc -> llvm-gcc-4.2
lrwxr-xr-x  1 root  wheel  12 Oct 19 06:54 /usr/bin/g++ -> llvm-g++-4.2
lrwxr-xr-x  1 root  wheel  21 Oct 20 20:07 /usr/bin/gcc-4.2 -> /usr/bin/llvm-gcc-4.2
lrwxr-xr-x  1 root  wheel  21 Oct 22 16:39 /usr/bin/g++-4.2 -> /usr/bin/llvm-g++-4.2
Clone this wiki locally