I am trying to follow this advice from stackoverflow and copy some library files from /usr/local/Cellar/openssl/1.0.1c
to /usr/lib/
.
I have tried cp
, ln -s
and even touch
, but they all fail. I am using the root
credentials:
joyce# whoami
root
In the right directory:
joyce# pwd
/usr/lib
But no write operation is permitted:
joyce# cp /usr/local/Cellar/openssl/1.0.2e_1/lib/libssl.1.0.0.dylib .
cp: ./libssl.1.0.0.dylib: Operation not permitted
joyce# ln -s /usr/local/Cellar/openssl/1.0.2e_1/lib/libssl.1.0.0.dylib .
ln: ./libssl.1.0.0.dylib: Operation not permitted
joyce# touch blah
touch: blah: Operation not permitted
Any idea how can I write to /usr/lib
as root
?
Best Answer
/usr/lib
is protected by SIP. Even if this wouldn't be the case, it's not the best idea to put your own stuff there as any system upgrade can wipe it.The better place to store such stuff (or link to it) is
/usr/local/lib
. You may need to pass appropriate flags to the linker then (or you point it directly to the Cellar folder).