Permission denied - / Library / Caches / Homebrew / Formula / nmap.brewing

I created a new user 'dad' on my macbook pro (OSX 10.8.4). "Dad" is the administrator. I have successfully installed homebrew as dad. It was previously installed by another user. I did:

sudo chown -R dad /usr/local/ cd /usr/local/ chmod -R 777 * 

But any attempt to install, for example:

 brew install nmap 

gives:

 Error: Permission denied - /Library/Caches/Homebrew/Formula/nmap.brewing 

It seems nmap.brewing does not exist:

 dad$ ls -l /usr/local/Library/Caches/Homebrew/Formula/nmap.brewing ls: /usr/local/Library/Caches/Homebrew/Formula/nmap.brewing: No such file or directory dad$ ls -l /Library/Caches/Homebrew/Formula/nmap.brewing ls: /Library/Caches/Homebrew/Formula/nmap.brewing: No such file or directory 

Any ideas?

+60
homebrew macos
Jul 12 '13 at 8:10
source share
4 answers

Fixed.

It seemed to me that I needed to own / Library / Caches / Homebrew

 sudo chown -R $USER /Library/Caches/Homebrew/ 
+151
Jul 12 '13 at 8:27
source share

Searching the brew manpage for /Library/Caches/Homebrew , it turns out that you can set the directory that uses homebrew to cache with the HOMEBREW_CACHE environment HOMEBREW_CACHE , or just create ~/Library/Caches/Homebrew . These approaches will be simpler than the chown approach if you are not an administrator.

+31
Jan 26 '14 at 15:34
source share

mkdir -p ~ / Library / Caches / Home-brew echo 'export HOMEBREW_CACHE = ~ / Library / Caches / Homebrew' → ~ / .bash_profile source ~ / .bash_profile

+1
Sep 21 '15 at 9:38
source share

I used the following command:

sudo chmod -R g + w / Library / Caches / Homebrew / Formula /

sudo chgrp -R staff / Library / Caches / Homebrew / Formula /

+1
Feb 02 '17 at 12:31 on
source share



All Articles