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
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!
curl -kL http://install.perlbrew.pl | bash perlbrew install perl-stable perlbrew install-cpanm cpanm --notest XML::LibXML cpanm Captcha::reCAPTCHA ...
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
brew upgrade followed it by another
==> This operation has freed approximately 5.6G of disk space.
This is amazing.
My take away:
brew leavesand delete packages you no longer care about
brew rmtreeand use it when deleting packages in order to delete former dependencies
brew cleanupevery now and then to delete old versions
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 firstname.lastname@example.org:kensanata/homebrew.git
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!
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
# DO NOT EDIT THIS 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: *** [inkview] Error 1 make: *** Waiting for unfinished jobs.... make: *** [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!! 😺 👍