MacOS SIP – How to Upgrade SVN on OSX 10.11 El Capitan with SIP Enabled

macossipsubversion

I am trying to upgrade my SVN version on OSX 10.11 El Capitan. I installed the latest SVN version by brew install svn. When I am typing svn --version I am still getting the old version. From a lot of reading, I understand that I need to change the symbolic link form the old SVN to the new SVN that was installed with brew. This is made by deleting the old symbolic link with sudo rm /usr/bin/svn and then creating the new one by sudo ln -s /usr/local/lib/svn /usr/lib/svn. the problem is that the new "System Integrity Protection" of the OS X El Capitan is blocking the accesses to /usr/bin directory. I found a simple way to disable the SIP but I am searching for a way to do this without disabling SIP. Is there a way to do this? What will be the best practice?

Best Answer

Instead of changing a protected file, why not change your path so that the newer SVN is called by your scripts and users?

That's best practice since you don't control the OS but you control the environment. Second best would be disable SIP and overwrite the file you intend to, then re-enable SIP. The reason it's second best is it takes longer, needs you to learn SIP disable, and the next time Apple patches the tool, your work is undone.

Changing path doesn't get undone when Apple updates the OS. This is the same even before SIP:

Just replace git for svn in the examples above.