2

I am trying to copy a file to /usr/lib, but permissions are denied. SIP is disabled. When trying to copy via terminal, getting "Read-only file system".enter image description here

bmike
  • 235,889
  • 1
    Which version of macOS? and why are you trying to do this - it is probablyt not the correct thing to do - if you give details of what the end result should be we should be able to provide a better answer – mmmmmm Feb 01 '21 at 20:13
  • macOS 10.15.7. This is for a software plugin install. need to copy/replace file titled libstdc++.6.0.9.dylib – julius_skeezer Feb 01 '21 at 20:54
  • Well, in Catalina or later, yes, it would be a read-only filesystem. If you don't understand what that means, most likely you shouldn't be copying things into /usr/lib. – Marc Wilson Feb 01 '21 at 20:54
  • 1
    You really do not want to replace that it will break every other c++ program – mmmmmm Feb 01 '21 at 21:02
  • More details pleas. That l brary if needed probably should be in the application bundle – mmmmmm Feb 01 '21 at 21:03
  • What software install is telling you that you should replace that file? – Marc Wilson Feb 01 '21 at 22:54
  • Hello Julius, would you please tell me your solution to fix this? – yts61 Dec 30 '21 at 22:24

1 Answers1

1

This is correct behavior. You should not under any shipping OS be able to paste to that directory.

Much better to use a script or PATH or environment variables to extend your library in /usr/local/lib or other locations intended for customization. The OS manages the /usr/lib/ directory so your files will get stomped the next time an OS update happens or cause other breakage.

bmike
  • 235,889
  • Would you please put some examples of the commands to fix this ? – yts61 Dec 30 '21 at 22:25
  • 1
    Hi @yts61 - so like use finder shortcut to open (command - G) /usr/local/lib and then paste? I’m not sure what you’re looking for. Maybe ask a new question that explains what you want to do and why you can’t accomplish it? – bmike Dec 31 '21 at 03:11
  • hi @bmike, thank you for the reply, yes, I just did. https://apple.stackexchange.com/questions/434362/mac-m1-how-to-copy-dylib-file-to-usr-lib-in-macos-big-sur please feel free to drop by if you have time. – yts61 Dec 31 '21 at 12:19
  • 1
    Aah @yts61 you need help changing the package so it no longer looks in usr lib and. It just pasting the files. Seems your cart is way out in front of your horse – bmike Dec 31 '21 at 15:26