Terminal Operation not Permitted - Rootless?

Discussion in 'OS X El Capitan (10.11)' started by MattZani, Oct 6, 2015.

  1. MattZani macrumors 68030

    MattZani

    Joined:
    Apr 20, 2008
    Location:
    UK
    #1
    In Yosemite I had renamed the Photos app so that it wouldn't launch, ever. It was a huge PITA for my workflow. El Cap has renamed it again so it works, but the command I used last time is blocked, assuming it's part of Rootless, is there an easy work around?

    The command is this:

    Code:
    sudo mv /Applications/Photos.app/Contents/MacOS/{,_}Photos
     
  2. KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #2
    Not without circumventing SIP/rootless. Either you turn it off or you try renaming the application from a Terminal on a different system (also works from Recovery).
     
  3. MattZani thread starter macrumors 68030

    MattZani

    Joined:
    Apr 20, 2008
    Location:
    UK
    #3
    So I could run the rename command in recovery, without having to fully disabling Rootless?
     
  4. KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #4
    Yes. The kernel prevents you from doing that, so you have to do it from the outside. If your disk is encrypted then you have to unlock it first. Note that you are running as root in Recovery, so be careful.
     
  5. MattZani thread starter macrumors 68030

    MattZani

    Joined:
    Apr 20, 2008
    Location:
    UK
    #5
    I assume the command isn't exactly the same, as it doesn't assume it has to run in my user?
     
  6. KALLT, Oct 6, 2015
    Last edited: Oct 6, 2015

    KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #6
    You don’t have to prepend the sudo command. The rest is the same. You just need to make sure that you access the right directory. The root directory is not “/” here, because you are not working from Macintosh HD, but Recovery HD. So using /Applications won’t work. Instead you have to change the working directory first and then use a relative path (without a “/” before Applications).

    In this case, assuming that your volume is indeed Macintosh HD:
    Code:
    cd /Volumes/Macintosh\ HD
    This changes your working directory. Use the pwd command to verify this (it will show you the full directory you are currently using). You can also use the ls command to list the folders in that directory (which should be: Applications, Library, Users and System, among others).

    Then you use this command (without the “/” before Applications):
    Code:
    mv Applications/Photos.app/Contents/MacOS/{,_}Photos
    Honestly though, if you are not used to such operations with the Terminal then please don’t try this. Just disable SIP temporarily, move the application and turn it on again.
     
  7. dsemf macrumors regular

    Joined:
    Jul 26, 2014
    #7
    Or you could just tell Utilities / Image Capture to not start Photos.

    Mount photo source device. Open Image Capture. Change action in the lower left corner.

    DS
     
  8. MattZani thread starter macrumors 68030

    MattZani

    Joined:
    Apr 20, 2008
    Location:
    UK
    #8
    Okay thanks, I thought it would be easier just to do it without disabling SIP but probably not by looking at it. Thanks for your help and detailed response though.

    This doesn't work when you've formatted the device, something I do after every import. It's infuriating there isn't an option to actually disable this.
     

Share This Page