Skip to content

Fix Homebrew (brew) Broken Links on 10.8

July 16, 2013

I was getting some brew errors like

Error: pathname contains : “000400\203\260>000400\261\260>000006et_user_reg00\320\26003ub_cc00\364\26003b”

All homebrew files are install in the /usr/local directory so I searched there for broken links with the command:

cd /usr/local
find -L . -type l

The result was the following:

./opt/gnutls
./opt/jpeg
./opt/libffi
./opt/libtasn1
./opt/nettle
./opt/p11-kit
./opt/pixman
./opt/pkg-config
./opt/xz

The output indicated that all broken links were located in the /usr/local/opt folder.

Example bad link:

lrwxr-xr-x   1 user  staff    23B Jan  2  2013 autoconf@ -> ../Cellar/autoconf/2.69
lrwxr-xr-x   1 user  staff    23B Jul 15 20:25 automake@ -> ../Cellar/automake/1.14
lrwxr-xr-x   1 user  staff    24B Jul 15 20:26 gettext@ -> ../Cellar/gettext/0.18.3
lrwxr-xr-x   1 user  staff    21B Jul  7 00:49 glib@ -> 
lrwxr-xr-x   1 user  staff    19B Jul  7 00:41 gmp@ -> ../Cellar/gmp/5.1.2
lrwxr-xr-x   1 user  staff    23B Jul 15 21:24 gnutls@ -> ../Cellar/gnutls/3.1.10
lrwxr-xr-x   1 user  staff    17B Jul  6 20:36 jpeg@ -> ???????$d???????q
lrwxr-xr-x   1 user  staff    23B Jul  9 01:32 libffi@ -> z?{?|?}?~???
lrwxr-xr-x   1 user  staff    22B Jul  9 01:32 libtasn1@ -> ??????????????????????

So I ran the following commands:

cd /usr/local/opt
unlink [formula]
ln -s ../Cellar/[formula]/[version] [formula]

Where [formula] is the link name and [version] is one of the version directories you have under the ../Cellar/[formula] directory.

Do the same for all “formulas” that have broken links and brew starts working again.
After you are done your /usr/local/opt directory should like this:

lrwxr-xr-x   1 user  staff    23B Jan  2  2013 autoconf@ -> ../Cellar/autoconf/2.69
lrwxr-xr-x   1 user  staff    23B Jul 15 20:25 automake@ -> ../Cellar/automake/1.14
lrwxr-xr-x   1 user  staff    24B Jul 15 20:26 gettext@ -> ../Cellar/gettext/0.18.3
lrwxr-xr-x   1 user  staff    22B Jul 15 21:25 glib@ -> ../Cellar/glib/2.36.3/
lrwxr-xr-x   1 user  staff    19B Jul  7 00:41 gmp@ -> ../Cellar/gmp/5.1.2
lrwxr-xr-x   1 user  staff    23B Jul 15 21:24 gnutls@ -> ../Cellar/gnutls/3.1.10
lrwxr-xr-x   1 user  staff    18B Jul 15 21:25 jpeg@ -> ../Cellar/jpeg/8d/
lrwxr-xr-x   1 user  staff    23B Jul 15 21:26 libffi@ -> ../Cellar/libffi/3.0.13
lrwxr-xr-x   1 user  staff    22B Jul 15 21:26 libtasn1@ -> ../Cellar/libtasn1/3.3

Pain in the butt…

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: