After trying Fink for a short while and DarwinPorts for a bit longer, after finally downloading and compiling all my stuff manually, I decided to give Homebrew a try. I run an old Mac Mini with Mac OS 10.6.8 on it. I did the radical thing and deleted all the stuff I installed myself:

sudo mv /usr/local /Users/alex/Desktop

I’m hoping to list all the stuff I will subsequently install on this page. Wish me luck! :)

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
brew doctor
brew tap homebrew/dupes  # rsync
brew install git
brew install gnupg       # gpg
brew install w3m         # view html files and browse the web in a terminal
brew install rsync       # backup
brew install id3lib      # id3info, id3tag
brew install poppler     # pdfimages
brew install gnutls      # starttls
brew install bitlbee     # IRC and instant messaging
brew install nmap        # portscanning
brew install flvstreamer # download .flv files
brew install ffmpeg      # convert flv to mp3
brew install mpg321      # play them
brew install gv          # view pdf files in Emacs, requires https://xquartz.macosforge.org/landing/
brew install fdupes      # find duplicate files
brew install wget        # wget is sometimes more intuitive than curl
brew install pdfjam      # resizing PDF files
brew install sane-backends # scanner
brew install trash       # use from the commandline to trash instead of delete
brew install --HEAD avidemux # simple video editing

Use brew rmtree to delete unused dependencies.

$ brew tap beeftornado/rmtree && brew install beeftornado/rmtree/brew-rmtree

Don’t forget to brew cleanup every now and then!


Possibly related... :)

curl -kL http://install.perlbrew.pl | bash
perlbrew install perl-stable
perlbrew install-cpanm
cpanm --notest XML::LibXML
cpanm Captcha::reCAPTCHA

2017-11-03 libxml2 and Homebrew and Perl

I installed a new Perl and needed to install XML::LibXML.

cpanm XML::LibXML

But that didn’t work. I got an error and in the log file it would say:

running xml2-config...The installed version of libxml2 VERSION 2.9.4
 is not compatible with XML::LibXML (and probably buggy)!

At first I thought it was Homebrew.

brew upgrade libxml2

But the error remained. The key is to temporarily change the PATH:

export PATH="/usr/local/opt/libxml2/bin:$PATH"
cpanm XML::LibXML

This makes sure the correct version of xml2-config gets called.


Comments on 2017-11-03 libxml2 and Homebrew and Perl

Thanks for the tip - I have had long time issues with this. OpenSSL is a little bit different, so the OpenSSL approach did not really apply - thanks again

jonasbn 2017-12-13 18:21 UTC

Add Comment

2017-02-03 Homebrew and Emacs


alex@Megabombus:~$ emacs
dyld: Library not loaded: /usr/local/opt/imagemagick/lib/libMagickWand-6.Q16.3.dylib
  Referenced from: /usr/local/bin/emacs
  Reason: image not found
Abort trap: 6

OK, reinstall...

alex@Megabombus:~$ brew reinstall emacs-mac
==> Reinstalling railwaycat/emacsmacport/emacs-mac --with-xml2 --with-official-icon --with-gnutls --with-imagemagick
==> Downloading https://bitbucket.org/mituharu/emacs-mac/get/emacs-25.1-mac-6.1.tar.gz
Already downloaded: /Users/alex/Library/Caches/Homebrew/emacs-mac-emacs-25.1-z-mac-6.1.tar.gz
==> Downloading https://s3.amazonaws.com/emacs-mac-port/Emacs25.icns
Already downloaded: /Users/alex/Library/Caches/Homebrew/emacs-mac--official-icon-25.icns
==> ./autogen.sh
==> ./configure --enable-locallisppath=/usr/local/share/emacs/site-lisp --infodir=/usr/local/Cellar/emacs-mac/emacs-25.1-z-mac-6.1/shar
==> make
==> Summary
🍺  /usr/local/Cellar/emacs-mac/emacs-25.1-z-mac-6.1: 4,067 files, 109.7M, built in 20 minutes 31 seconds


Add Comment

2017-02-03 Homebrew and Disk Space

I did not know about this:

alex@Megabombus:~$ brew cleanup
==> This operation has freed approximately 8.1G of disk space.
alex@Megabombus:~$ brew cask cleanup
==> This operation has freed approximately 2.8GB of disk space.


Add Comment

2016-11-26 GD again

I wanted to use GD::Barcode::QRcode but it would not work. Was GD not installed? I tried to install it using cpanm GD but it wouldn’t work. Tests kept failing.

I had something installed via Homebrew. OK, so brew unlink gd and see whether that helps. Now try installing cpanm GD and I get a different problem. Apparently my libgd is borked. I see unmet recommended dependencies when looking at brew info libgd. One strikes me as particularly odd: no libpng installed. Trying brew reinstall libgd now. Regenerating the font cache seems to take a while.

I am already regretting this.

And indeed, it doesn’t help. cpanm GD still fails.

alex@Megabombus:~/.cpanm/work/1480171923.14458/GD-2.56$ prove -v -b -l t/GD.t 
t/GD.t .. 
ok 1 - use GD;
ok 2 - use GD::Simple;
1. Testing using gd2 support.
ok 3 - image comparison test 1
ok 4 - image comparison test 2
ok 5 - image comparison test 3
ok 6 - image comparison test 4
ok 7 - image comparison test 5
ok 8 - image comparison test 6
not ok 9 - image comparison test 7
ok 10 - round trip gd
ok 11 - round trip gd2

1.   Failed test 'image comparison test 7'
1.   at t/GD.t line 249.
1. Looks like you failed 1 test of 11.
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/11 subtests 

Test Summary Report
t/GD.t (Wstat: 256 Tests: 11 Failed: 1)
  Failed test:  9
  Non-zero exit status: 1
Files=1, Tests=11,  1 wallclock secs ( 0.04 usr  0.01 sys +  0.16 cusr  0.03 csys =  0.24 CPU)
Result: FAIL

Looking at the test code, it seems that the essential bits are related to fonts:

  # Some TTFs
  $im->stringFT($black,FONT,12.0,0.0,20,20,"Hello world!") || warn $@;
  $im->stringFT($red,FONT,14.0,0.0,20,80,"Hello world!") || warn $@;
  $im->stringFT($blue,FONT,30.0,-0.5,60,100,"Goodbye cruel world!") || warn $@;

Time to cpanm -f GD...


Comments on 2016-11-26 GD again

And once again, cpanm -f GD. This makes me think I should switch to ImageMagick one of these days.

– Alex Schroeder 2017-03-18 18:43 UTC

Add Comment

2016-09-21 OSX Emacs

Same procedure as always, one would think. But somehow, it manages to be different every single time.

This is what I want:

alex@Megabombus:~$ brew install railwaycat/emacsmacport/emacs-mac --with-gnutls --with-imagemagick --with-official-icon --with-xml2
==> Installing emacs-mac from railwaycat/emacsmacport

Homebrew also wanted me to do some other stuff, oh well.

alex@Megabombus:~$ sudo chown root:wheel /usr/local
alex@Megabombus:~$ sudo mv /opt/homebrew-cask/Caskroom /usr/local


Comments on 2016-09-21 OSX Emacs


alex@Megabombus:~$ brew update
Checking out v1.0.6 in /usr/local/Homebrew...
To checkout master in /usr/local/Homebrew run:
  'cd /usr/local/Homebrew && git checkout master
Checking out v1.0.6 in /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask...
To checkout master in /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask run:
  'cd /usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask && git checkout master
fatal: Cannot update paths and switch to branch 'v1.0.6' at the same time.

And many repeats. WTF!

Google found an answer on Stack Exchange that seemed similar enough for me to try it:

alex@Megabombus:~$ cd $(brew --repo); git fetch; git reset --hard origin/master; brew update
HEAD is now at faebc64 Merge pull request #1216 from reitermarkus/fix-language-audit
Updated 11 taps (caskroom/cask, homebrew/boneyard, homebrew/core, homebrew/dupes, homebrew/fuse, homebrew/games, homebrew/science, homebrew/services, homebrew/tex, homebrew/versions, homebrew/x11).

Looks good!

Also, I learned that now --enable-mac-app is required...

And so:

alex@Megabombus:~$ brew install railwaycat/emacsmacport/emacs-mac --with-gnutls --with-imagemagick --with-official-icon --with-xml2 --enable-mac-app
Warning: railwaycat/emacsmacport/emacs-mac-emacs-25.1-z-mac-6.0 already installed
alex@Megabombus:~$ brew remove railwaycat/emacsmacport/emacs-mac
Uninstalling /usr/local/Cellar/emacs-mac/emacs-25.1-z-mac-6.0... (4,066 files, 109.9M)
emacs-mac emacs-24.5-z-mac-5.17, emacs-24.5-z-mac-5.18 are still installed.
Remove all versions with `brew uninstall --force emacs-mac`.
alex@Megabombus:~$ brew uninstall --force emacs-mac
Uninstalling emacs-mac... (7,874 files, 225.7M)
alex@Megabombus:~$ brew install railwaycat/emacsmacport/emacs-mac --with-gnutls --with-imagemagick --with-official-icon --with-xml2 --enable-mac-app
==> Installing emacs-mac from railwaycat/emacsmacport
==> Installing dependencies for railwaycat/emacsmacport/emacs-mac: nettle, imagemagick
==> Installing railwaycat/emacsmacport/emacs-mac dependency: nettle
==> Caveats
This is YAMAMOTO Mitsuharu's "Mac port" addition to
GNU Emacs 25. This provides a native GUI support for Mac OS X
10.6 - 10.12. After installing, see README-mac and NEWS-mac
in /usr/local/Cellar/emacs-mac/emacs-25.1-z-mac-6.0 for the port details.

Emacs.app was installed to:

To link the application to default Homebrew App location:
  brew linkapps
  ln -s /usr/local/Cellar/emacs-mac/emacs-25.1-z-mac-6.0/Emacs.app /Applications
Other ways please refer:

For an Emacs.app CLI starter, see:

.app bundles were installed.
Run `brew linkapps emacs-mac` to symlink these to /Applications.
==> Summary
🍺  /usr/local/Cellar/emacs-mac/emacs-25.1-z-mac-6.0: 4,067 files, 109.8M, built in 15 minutes 56 seconds
alex@Megabombus:~$ brew linkapps emacs-mac
Linking: /usr/local/opt/emacs-mac/Emacs.app
Linked 1 app to /Applications

– Alex Schroeder 2016-10-06 19:47 UTC

Add Comment

2016-07-18 w3m and Emacs Wiki

w3m is a text browser. I use it a lot if I need to test stuff. Recently, I got an email saying that Emacs Wiki had an invalid certificate. Everything seemed to be fine, however. But a few minutes ago, I tried to run w3m https://www.emacswiki.org/ from my Terminal (OSX El Capitan) and got an SSL error.

alex@Megabombus:~$ w3m -dump_extra https://www.emacswiki.org/
SSL error: error:00000000:lib(0):func(0):reason(0)
w3m: Can't load https://www.emacswiki.org/.

Thanks to twb on #emacs, I found the problem. He said: “What’s ldd called on OS X? Find out if w3m is using gnutls or openssl.” The equivalent to ldd on OSX is otool -L.

As it turns out, a simple reinstall switched from libssl 0.9.8 to 1.0.0 and now it works.

alex@Megabombus:~$ otool -L `which w3m`
	/usr/local/lib/libgc.1.dylib (compatibility version 2.0.0, current version 2.3.0)
	/usr/lib/libssl.0.9.8.dylib (compatibility version 0.9.8, current version 50.0.0)
	/usr/lib/libcrypto.0.9.8.dylib (compatibility version 0.9.8, current version 50.0.0)
	/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
alex@Megabombus:~$ brew reinstall w3m
==> Reinstalling w3m
==> Downloading https://homebrew.bintray.com/bottles/w3m-0.5.3.el_capitan.bottle.tar.gz
`#``#``#``#``#``#``#``#``#``#``#``#``#``#`## 100,0%
==> Pouring w3m-0.5.3.el_capitan.bottle.tar.gz
🍺  /usr/local/Cellar/w3m/0.5.3: 23 files, 1.7M
alex@Megabombus:~$ otool -L `which w3m`
	/usr/local/opt/bdw-gc/lib/libgc.1.dylib (compatibility version 2.0.0, current version 2.3.0)
	/usr/local/opt/openssl/lib/libssl.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib (compatibility version 1.0.0, current version 1.0.0)
	/usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1225.1.1)


Add Comment

2016-03-24 Homebrew, Uninstalling

How does one remove all the unused dependencies hanging around? I have no idea. If you want to remove a particular package and all it’s unused dependencies, you could use brew rmtree.

Yesterday, I used something different: First, I used brew leaves to create a list of stuff that isn’t a dependency for anything else I have installed. Then I edited this list down to the stuff I wanted to keep and ran brew_clean on it.

This removed a lot of packages, but also resulted in many messages like these:

Uninstalling /usr/local/Cellar/glibmm/2.46.3... (1,674 files, 43.6M)
glibmm 2.40.0, 2.42.0, 2.44.0 are still installed.
Remove them all with `brew uninstall --force glibmm`.

So I had to go through the output and manually uninstall the older versions.

$ brew uninstall --force glibmm
Uninstalling glibmm... (4,832 files, 113.4M)

I didn’t know brew was keeping so many old versions around! I should have used brew cleanup.

Just to be sure, I ran it.

$ brew cleanup
==> This operation has freed approximately 6.8G of disk space.

Wow! I don’t think I ran this, ever.

I had a few messages saying that I had not installed the latest version:

Warning: Skipping homebrew/dupes/rsync: most recent version 3.1.2 not installed

I ran brew upgrade followed it by another brew clean.

==> This operation has freed approximately 5.6G of disk space.

This is amazing.

My take away:

  1. check the output of brew leaves and delete packages you no longer care about
  2. install brew rmtree and use it when deleting packages in order to delete former dependencies
  3. run brew cleanup every now and then to delete old versions


Comments on 2016-03-24 Homebrew, Uninstalling

Another one to free some space:

alex@Megabombus:~$ brew cask cleanup
==> Removing cached downloads
==> This operation has freed approximately 2.8G of disk space.

– Alex Schroeder 2016-10-15 14:15 UTC

Add Comment

2014-06-04 Homebrew, GitHub

A reminder for my future self: When fixing something in /usr/local (which is the domain of Homebrew, just commit it, and then:

git push git@github.com:kensanata/homebrew.git

Commits will show up in my Homebrew fork and I’ll be able to create a pull request from there. Such as this one.

Also, as noted in the pull request: “For future reference the preferred commit message format for simple version updates is libcaca 0.99b19.”

You are welcome, future me.

Also, I managed to make a mess of merges, consecutive commits, pushed and all, and now I’m confused. Aaargh!


Add Comment

2014-04-26 Down the rabbit hole of software installing

It all started with this:

alex@Megabombus:~$ inkscape
dyld: Library not loaded: /usr/local/lib/libpng15.15.dylib
  Referenced from: /usr/local/bin/inkscape
  Reason: image not found
Trace/BPT trap: 5

It seemed I had 1.5 and 1.6 in the Homebrew Cellar, but only 1.6 was installed. I tried to have both libraries linked but missed this hint:

ln -s /usr/local/Cellar/libpng/1.5.18/lib/libpng15.15.dylib /usr/local/lib/libpng15.15.dylib

(It would have been 1.5.17 in my case.)

Instead I deleted both versions of libpng and hoped that reinstalling all the stuff would work.

brew update && brew upgrade

But look at this:

alex@Megabombus:~$ brew reinstall inkscape
==> Reinstalling inkscape
intltool: Unsatisfied dependency: XML::Parser
Homebrew does not provide Perl dependencies; install with:
  cpan -i XML::Parser
Error: An unsatisfied requirement failed this build.

Now we’re switching from Homebrew issues to Perl issues!

alex@Megabombus:~$ cpanm XML::Parser
--> Working on XML::Parser
Fetching http://www.cpan.org/authors/id/T/TO/TODDR/XML-Parser-2.41.tar.gz ... OK
Configuring XML-Parser-2.41 ... OK
Building and testing XML-Parser-2.41 ... FAIL
! Installing XML::Parser failed. See /Users/alex/.cpanm/work/1398513458.18494/build.log for details. Retry with --force to force install it.
alex@Megabombus:~$ less /Users/alex/.cpanm/work/1398513458.18494/build.log

Looking at the log file:

PERL_DL_NONLAZY=1 /Users/alex/perl5/perlbrew/perls/perl-5.18.1/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
Can't load '/Users/alex/.cpanm/work/1398513458.18494/XML-Parser-2.41/blib/arch/auto/XML/Parser/Expat/Expat.bundle' for module XML::Parser::Expat: dlopen(/Users/alex/.cpanm/work/1398513458.18494/XML-Parser-2.41/blib/arch/auto/XML/Parser/Expat/Expat.bundle, 2): no suitable image found.  Did find:
        /Users/alex/.cpanm/work/1398513458.18494/XML-Parser-2.41/blib/arch/auto/XML/Parser/Expat/Expat.bundle: mach-o, but wrong architecture at /Users/alex/perl5/perlbrew/perls/perl-5.18.1/lib/5.18.1/darwin-2level/DynaLoader.pm line 194.
 at /Users/alex/.cpanm/work/1398513458.18494/XML-Parser-2.41/blib/lib/XML/Parser.pm line 18.
Compilation failed in require at /Users/alex/.cpanm/work/1398513458.18494/XML-Parser-2.41/blib/lib/XML/Parser.pm line 18.

WTF “wrong architecture”? Now I’m thinking of our recent upgrade of the laptop to OSX Mavericks. Oh, and before that I migrated my account from the old Mac Mini using Mac OS 10.6.8 to this laptop... Considering that we’re using Perlbrew and that the resulting Perl is stored in my home directory, this might indeed be an issue.

Thus, deeper into the rabbit hole we go!

alex@Megabombus:~$ perlbrew install perl-stable
Fetching perl 5.18.2 as /Users/alex/perl5/perlbrew/dists/perl-5.18.2.tar.bz2
Download http://www.cpan.org/src/5.0/perl-5.18.2.tar.bz2 to /Users/alex/perl5/perlbrew/dists/perl-5.18.2.tar.bz2
Installing /Users/alex/perl5/perlbrew/build/perl-5.18.2 into ~/perl5/perlbrew/perls/perl-5.18.2

I think I will go and take some pretty pictures in the mean time.

In the end, everything seems to be ready.

alex@Megabombus:~$ cpanm XML::Parser
! Can't write to /Library/Perl/5.16 and /usr/local/bin: Installing modules to /Users/alex/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /Library/Perl/5.16 and /usr/local/bin)
!   - Configure local::lib your existing local::lib in this shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!         cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
XML::Parser is up to date. (2.41)
alex@Megabombus:~$ cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
--> Working on local::lib
Fetching http://www.cpan.org/authors/id/E/ET/ETHER/local-lib-2.000011.tar.gz ... OK
Configuring local-lib-2.000011 ... OK
==> Found dependencies: ExtUtils::MakeMaker
--> Working on ExtUtils::MakeMaker
Fetching http://www.cpan.org/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-6.96.tar.gz ... OK
Configuring ExtUtils-MakeMaker-6.96 ... OK
Building and testing ExtUtils-MakeMaker-6.96 ... OK
Successfully installed ExtUtils-MakeMaker-6.96 (upgraded from 6.63_02)
Building and testing local-lib-2.000011 ... OK
Successfully installed local-lib-2.000011
2 distributions installed

I did notice something strange, though. When I opened a new terminal:

ERROR: The installation "perl-5.18.1" is unknown.

I had to manually change perl-5.18.1 to perl-5.18.2 in my ~/.perlbrew/init file:

export PERLBREW_MANPATH="/Users/alex/perl5/perlbrew/perls/perl-5.18.2/man"
export PERLBREW_PATH="/Users/alex/perl5/perlbrew/bin:/Users/alex/perl5/perlbrew/perls/perl-5.18.2/bin"
export PERLBREW_PERL="perl-5.18.2"
export PERLBREW_ROOT="/Users/alex/perl5/perlbrew"
export PERLBREW_VERSION="0.66"

Yeah, ignore the comment on the first line. I wonder why perlbrew didn’t do this automatically when I uninstalled 5.18.1 and installed 5.18.2. Oh well.

And now, Inkscape!

alex@Megabombus:~$ brew reinstall inkscape
==> Reinstalling inkscape
==> Installing inkscape dependency: boost-build
==> Downloading https://github.com/boostorg/build/archive/boost-1.55.0.tar.gz
`#``#``#``#``#``#``#``#``#``#``#``#``#``#`## 100.0%
==> ./bootstrap.sh
=º  /usr/local/Cellar/boost-build/1.55.0: 269 files, 3.0M, built in 65 seconds
==> Installing inkscape
==> Downloading https://downloads.sourceforge.net/project/inkscape/inkscape/0.48.4/inkscape-0.48.4.tar.gz
Already downloaded: /Library/Caches/Homebrew/inkscape-0.48.4.tar.gz
==> ./configure --prefix=/usr/local/Cellar/inkscape/0.48.4 --enable-lcms --disable-poppler-cairo
==> make install
collect2: ld returned 1 exit status
make[1]: *** [inkview] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: *** [inkscape] Error 1
make: *** [install-recursive] Error 1

READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting

These open issues may also help:
inkscape fails on 10.9.2 (https://github.com/Homebrew/homebrew/issues/28556)


OK, following the instructions of mistydemeo:

alex@Megabombus:~$ rm -rf /Library/Caches/Homebrew/inkscape--bzr
alex@Megabombus:~$ brew install inkscape --HEAD
Warning: inkscape-HEAD already installed
alex@Megabombus:~$ brew uninstall inkscape
Uninstalling /usr/local/Cellar/inkscape/HEAD...
alex@Megabombus:~$ brew install inkscape --HEAD
==> Cloning lp:inkscape/0.48.x
Not checking SSL certificate for xmlrpc.launchpad.net.
You have not informed bzr of your Launchpad ID, and you must do this to
write to Launchpad or access private data.  See "bzr help launchpad-login".
==> ./autogen.sh/s / Build phase:Apply phase:adding file 280/282                                                    
==> ./configure --prefix=/usr/local/Cellar/inkscape/HEAD --enable-lcms --disable-poppler-cairo
==> make install
🍺  /usr/local/Cellar/inkscape/HEAD: 853 files, 81M, built in 22.6 minutes

Testing... YES!! 😺 👍


Add Comment


Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Please say HELLO.