How to install subversion using homebrew on OSX

I tried

$ brew install subversion 

and see

 Error: Cannot write to /usr/local/Cellar 

Did I miss something?

+7
svn homebrew osx-mountain-lion macos
source share
4 answers

Check permissions on /usr/local/Cellar/ .

+5
source share

Your /usr/local/Cellar/ not writable by brew. Check permissions on this folder.

 ls -lA /usr/local/ | grep Cellar # dr-xr-xr-x 18 ***** admin 612 Feb 18 08:47 Cellar # ^ ^ ^ 

In this case, he needs write permissions:

 chmod u+rw /usr/local/Cellar/ 

It is also possible that the folder is owned by root .

 ls -lA /usr/local/ | grep Cellar # drwxr-xr-x 18 root root 612 Feb 18 08:47 Cellar # ^^^^ ^^^^ 

In this case, you need to change the owner:

 chown $(whoami):admin /usr/local/Cellar/ 

And you may have to execute the chown and chmod commands.

This is usually caused by running brew with sudo ( sudo brew install subversion ). Usually you do not want this. brew should ask for your password if it needs sudo and this will give the folders and files the correct permissions.

+4
source share

Try

sudo brew install subversion

0
source share

You must change ownership and permissions please try

 sudo chown -R `whoami`:admin /usr/local/* 
0
source share

All Articles