Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

macos

homebrew

I have created a new user 'dad' on my macbook pro (OSX 10.8.4). 'dad' is an administrator. I've 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, e.g:

brew install nmap 

Gives:

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

It seems nmap.brewing doesn't 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?

like image 543
Mike Hadlow Avatar asked Jul 12 '13 08:07

Mike Hadlow


2 Answers

Fixed.

It seemed I needed to take ownership of /Library/Caches/Homebrew

sudo chown -R $USER /Library/Caches/Homebrew/ 
like image 195
Mike Hadlow Avatar answered Sep 21 '22 13:09

Mike Hadlow


Searching the brew manpage for /Library/Caches/Homebrew, it turns out that you can set the directory that homebrew uses for caching with the the HOMEBREW_CACHE environment variable, or just create ~/Library/Caches/Homebrew. These approaches will be easier than the chown approach if you’re a non-administrator.

like image 23
andrewdotn Avatar answered Sep 25 '22 13:09

andrewdotn