title: Homebrew multi user setup
body: <p>I was trying to fix my Homebrew installation for multiple users and found a <a href="http://web.archive.org/web/20160327060143/http://blog.strug.de/2012/06/my-homebrew-multi-user-setup/" rel="nofollow noreferrer">guide on strug.de</a>, which aims to solve exactly this issue.</p>
  
  <p>I created a <code>brew</code> user group, added both of my users in that group and ran this to adjust the permissions:</p>
  
  <pre><code>sudo chgrp -R brew /usr/local
  sudo chmod -R g+w /usr/local
  sudo chgrp -R brew /Library/Caches/Homebrew
  sudo chmod -R g+w /Library/Caches/Homebrew
  sudo chgrp -R brew /opt/homebrew-cask
  sudo chmod -R g+w /opt/homebrew-cask
  </code></pre>
  
  <p>Let's assume I did this while logged into user account <strong>A</strong>. A few days later I'm logged into user account <strong>B</strong> and try to install Dropbox via Cask. That works like a charm, since we fixed the permissions earlier so the brew group is allowed to write in those folders as well.</p>
  
  <p>Now another few days later, I am back logged into account <strong>A</strong> and want to get rid of Dropbox. I run the following command but stuck with the permission error:</p>
  
  <pre><code>$ brew cask install dropbox --force
  ==&gt; Downloading https://www.dropbox.com/download?plat=mac&amp;full=1
  Already downloaded: /Library/Caches/Homebrew/dropbox-latest
  ==&gt; Symlinking App 'Dropbox.app' to '/Users/friedmann/Applications/Dropbox.app'
  Error: Permission denied - /opt/homebrew-cask/Caskroom/dropbox/.metadata/latest/20150217070443.598
  
    Most likely, this means you have an outdated version of homebrew-cask. Please run:
  
        brew update &amp;&amp; brew upgrade brew-cask &amp;&amp; brew cleanup &amp;&amp; brew cask cleanup
  
    If this doesn’t fix the problem, please report this bug:
  
        https://github.com/caskroom/homebrew-cask/issues
  
  /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `mkdir'
  [...]
  </code></pre>
  
  <p>To fix this for the user <strong>B</strong>, I have to run the <code>chgrp</code>'s and <code>chmod</code>'s (as stated above) again. However this workaround is not really appreciated, since I don't want to "randomly" run all the commands whenever I switch back and forth between my user accounts.</p>
  
  <p>Is there anything that I am missing or that I did wrong acccording to the guide?</p>
  
  <p>I'm not sure how the author of the guide solved this.</p>