17

I recently installed homebrew-cask and one of the things that I see is that it installs applications by default into the following directories:

  1. Versioned package downloads => /opt/homebrew-cask/Caskroom/

    Example : /opt/homebrew-cask/Caskroom/pdftk/2.02

  2. Application binaries/libraries => /opt/

    Example : /opt/pdftk/bin/

Instead of using the /opt directory, I would really like to use a directory located in /usr/local which is where my homebrew installation resides.

I can see from the docs that I can set an environment variable for #1, but I can't seem to figure out where to change #2.

I'd like to have the above two settings go to:

  1. /usr/local/Caskroom/packages/pdftk/2.02
  2. /usr/local/Caskroom/pdftk/bin

Any ideas on how I can change both settings or are there good ideas why I wouldn't want to do this?

Thanks.

rchawdry
  • 1,256
  • 1
  • 10
  • 14

1 Answers1

29

From the Caskroom manual (specifically the Usage manual) you can change where the actual application will be installed by adding a line like this to your .bash_profile or .zshenv etc.

# Specify your defaults in this environment variable
export HOMEBREW_CASK_OPTS="--appdir=/Applications --caskroom=/usr/local/Caskroom"
MFDoom
  • 406
  • 5
  • 4
  • 5
    I was having issues with `export HOMEBREW_CASK_OPTS="--appdir=/Applications --caskroom=/usr/local/Caskroom"` An issue post on brew's github suggests to remove `--caskroom=/usr/local/Caskroom` from that command. Works fine now. – Sam Lehman May 12 '16 at 17:04