Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install subversion using homebrew on OSX

i tried

$ brew install subversion

and see

Error: Cannot write to /usr/local/Cellar

Am I missing anything?

like image 441
daydreamer Avatar asked Oct 17 '13 17:10

daydreamer


People also ask

Can we use SVN on Mac?

svn can not be used in MacOS Big Sur 11.0.


2 Answers

Check the permissions on /usr/local/Cellar/.

like image 198
Peter Eisentraut Avatar answered Sep 22 '22 04:09

Peter Eisentraut


Your /usr/local/Cellar/ is not writable to brew. Check permissions on that folder.

ls -lA /usr/local/ | grep Cellar

# dr-xr-xr-x   18 *****  admin    612 Feb 18 08:47 Cellar
#   ^  ^  ^

In this case it needs write permissions:

chmod u+rw /usr/local/Cellar/

It's also possible 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 do both the chown and chmod commands.

This is typically caused by running brew with sudo (sudo brew install subversion). You generally don't want to do this. brew should ask for your password if it needs to sudo and this will give folders and files the correct permissions.

like image 23
Nate Avatar answered Sep 19 '22 04:09

Nate