Bullrico

Solving front-end and UX dilemmas

Brew Update Problems

Having a two year old Macbook Pro and not keeping track of cruft that accumulates over time, I tried to do a ‘brew update’ and promptly went down a rabbit hole for the next hour.

First, tried brew doctor

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
$ brew doctor
Error: The following libiconv files were detected in /usr/local:
include/iconv.h
Homebrew doesn't provide a libiconv formula, and expects to link against
the system version in /usr/lib.

If you have an alternate libiconv, many formulae will fail to compile or
link, especially if it wasn't compiled with the proper architectures.
Error: Your Homebrew is outdated
You haven't updated for at least 24 hours, this is a long time in brewland!
Error: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libcharset.1.dylib    /usr/local/lib/libfreetype.6.dylib    /usr/local/lib/libiconv.2.dylib
Error: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
    /usr/local/lib/libcharset.la    /usr/local/lib/libfreetype.la    /usr/local/lib/libiconv.la
Error: Unbrewed .pc files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .pc files:
    /usr/local/lib/pkgconfig/freetype2.pc
Error: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
    /usr/local/lib/libcharset.a    /usr/local/lib/libfreetype.a
Error: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built.

    coffee-script
    git
    git-flow
    imagemagick
    ios-sim
    mysql
    node
    redis
    sphinx
    wget
Error: Your compilers are different from the standard versions for your Xcode.
If you have Xcode 4.3 or newer, you should install the Command Line Tools for
Xcode from within Xcode's Download preferences.
Otherwise, you should reinstall Xcode.

So I moved cruft…

1
2
3
4
5
6
7
8
9
10
11
12
13
$ mv include/iconv.h include/iconv.h.old
$ mv include/iconv.h.old include/iconv.h
$ mv include/iconv.h include/iconv.h.old
$ mv /usr/local/lib/libcharset.1.dylib /usr/local/lib/libcharset.1.dylib.old
$ mv /usr/local/lib/libfreetype.6.dylib /usr/local/lib/libfreetype.6.dylib.old
$ mv /usr/local/lib/libiconv.2.dylib /usr/local/lib/libiconv.2.dylib.old
$ mv /usr/local/lib/libcharset.la /usr/local/lib/libcharset.la.old
$ mv /usr/local/lib/libfreetype.la /usr/local/lib/libfreetype.la.old
$ mv /usr/local/lib/libiconv.la /usr/local/lib/libiconv.la.old
$ mv /usr/local/lib/pkgconfig/freetype2.pc /usr/local/lib/pkgconfig/freetype2.pc.old
$ mv /usr/local/lib/libcharset.a /usr/local/lib/libcharset.a.old
$ mv /usr/local/lib/libfreetype.a /usr/local/lib/libfreetype.a.old
$ cd /usr/local/Cellar/coffee-script

… removed old dirs in /usr/local/Cellar, then did a brew link on all unlinked kegs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ brew link git-flow
Linking /usr/local/Cellar/git-flow/0.4.1... 0 symlinks created
$ brew link imagemagick
Linking /usr/local/Cellar/imagemagick/6.7.1-1... 1350 symlinks created
$ brew link ios-sim
Linking /usr/local/Cellar/ios-sim/1.1... 0 symlinks created
$ brew link mysql
Linking /usr/local/Cellar/mysql/5.5.10... 116 symlinks created
$ brew link node
Error: node has multiple installed versions
$ brew link node
Linking /usr/local/Cellar/node/0.6.19... 6 symlinks created
$ brew link redis
Error: redis has multiple installed versions

At this point, I was still getting

1
2
3
Error: You have uncommitted modifications to Homebrew's core.
Unless you know what you are doing, you should run:
    cd /usr/local && git reset --hard

Another try…

1
2
$ cd /usr/local && git reset --hard
HEAD is now at 01c2120 scm-manager 1.17

Checking git (I don’t know why, to be honest)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$ git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
# Library/Aliases/sshfs
# Library/Contributions/examples/
# Library/Formula/allegro.rb
# Library/Formula/distribute.rb
# Library/Formula/git-diffall.rb
# Library/Formula/git-subtree.rb
# Library/Formula/lbdb.rb
# Library/Formula/libdrizzle.rb
# Library/Formula/libqrencode.rb
# Library/Formula/manto.rb
# Library/Formula/metapixel.rb
# Library/Formula/moxi.rb
# Library/Formula/ncursesw.rb
# Library/Formula/npm.rb
# Library/Formula/openldap.rb
# Library/Formula/pip.rb
# Library/Formula/readpst.rb
# Library/Formula/redcar.rb
# Library/Formula/rsync.rb
# Library/Formula/sc.rb
# Library/Formula/sshfs-fuse.rb
# Library/Formula/stax-sdk.rb
# Library/Homebrew/beer_events.rb
# Library/Homebrew/brew.h.rb
# Library/Homebrew/brew_doctor.rb
# Library/Homebrew/update.rb
# Library/Perl/
nothing added to commit but untracked files present (use "git add" to track)

I forget now where I found the following step (probable StackOverflow), but this final step did the trick: git clean -df

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
$ git clean -df
Removing Library/Aliases/sshfs
Removing Library/Contributions/examples/
Removing Library/Formula/allegro.rb
Removing Library/Formula/distribute.rb
Removing Library/Formula/git-diffall.rb
Removing Library/Formula/git-subtree.rb
Removing Library/Formula/lbdb.rb
Removing Library/Formula/libdrizzle.rb
Removing Library/Formula/libqrencode.rb
Removing Library/Formula/manto.rb
Removing Library/Formula/metapixel.rb
Removing Library/Formula/moxi.rb
Removing Library/Formula/ncursesw.rb
Removing Library/Formula/npm.rb
Removing Library/Formula/openldap.rb
Removing Library/Formula/pip.rb
Removing Library/Formula/readpst.rb
Removing Library/Formula/redcar.rb
Removing Library/Formula/rsync.rb
Removing Library/Formula/sc.rb
Removing Library/Formula/sshfs-fuse.rb
Removing Library/Formula/stax-sdk.rb
Removing Library/Homebrew/beer_events.rb
Removing Library/Homebrew/brew.h.rb
Removing Library/Homebrew/brew_doctor.rb
Removing Library/Homebrew/update.rb
Removing Library/Perl/

Et voila

1
2
$ brew doctor
Your system is raring to brew.

Comments