Permissions

Discussion in 'macOS Sierra (10.12)' started by davvanc, Sep 21, 2016.

  1. davvanc macrumors member

    Joined:
    Oct 29, 2015
    #1
    Does anyone know what the terminal command is in Sierra to repair permissions? (long story, font related and Onyx for 10.12 isn't out yet)
    To repair permissions in OS X 10.11 we could use the following command in the Terminal:
    sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume /
    but in Sierra that produces an error message "command not found".
     
  2. AdoTedo macrumors newbie

    AdoTedo

    Joined:
    Sep 22, 2016
    #2

    The command has been removed completely fro macOs Sierra. It seems the command is performed automatically during the disk repair command in Disk utility
     
  3. KALLT macrumors 601

    Joined:
    Sep 23, 2008
  4. davvanc, Sep 22, 2016
    Last edited: Sep 22, 2016

    davvanc thread starter macrumors member

    Joined:
    Oct 29, 2015
    #4
    Not sure if there is an issue or not, but judging from past experience i think there well may be a problem. I disabled (copied and then deleted) some of the fonts in Sierra, as they get shown in Office 2011 even if turned off in FontBook, and realized I deleted one file I shouldn't have, so I copied that font file back to the Library/Fonts folder.
    Previously in El Cap, a similar incident caused repair permissions to note that that moved and then replaced font file was repaired. So, I thought it might be a good idea to try and repair the system folder's permissions. Will try the suggestion above.
     
  5. KALLT, Sep 22, 2016
    Last edited: Sep 23, 2016

    KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #5
    Copying files does not retain ownership and permissions. You would be going from root:wheel to user:staff and perhaps also different read/write/execute permissions.

    You should move files instead. You can restore the original permissions of the font(s) in question with:
    Code:
    sudo chown root:wheel /System/Library/Fonts/insert_font_here
    sudo chmod u=rw,go=r /System/Library/Fonts/insert_font_here

    Disk Utility does not repair permissions anymore either. The problem presents itself, because you are modifying system files, which Apple no longer supports. To rectify this, you have fourthree options: (1) change the permissions yourself, (2) reinstall the system from Recovery (this does not delete your files, it only repairs the system), (3) wait for the next system update (this is when a permissions repair will be performed now)., (4) repair permissions with pkgutil.
    Code:
    sudo pkgutil --verify com.apple.pkg.Essentials
    sudo pkgutil --repair com.apple.pkg.Essentials

    Note: I haven’t actually tested this in Sierra though and have never repaired this particular package with this command. Though I believe it should do what the repair_packages command did. You should verify the permissions first and see what comes up.
     
  6. davvanc thread starter macrumors member

    Joined:
    Oct 29, 2015
    #6
    Thanks for the info! I tried to use the "sudo pkgutil --verify com.apple.pkg.Essentials" command
    and got an error; something about inappropriate path to repair_??? so I think the pkgutil command will not work.
    The file I deleted and copied back was in the Library/Fonts folder, not the System/Library/Fonts folder.
    Will the comands as modified below work correctly for the Library/Fonts folder?
    Code:
    sudo chown root:wheel /Library/Fonts/insert_font_here
    sudo chmod u=rw,go=r /Library/Fonts/insert_font_here
    Thanks in advance for your help!
     
  7. KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #7
    Yes, preinstalled fonts in /Library/Fonts have the same permissions, so the last commands are correct.

    The pkgutil command probably fails because the package name has changed in Sierra. You can get a list of packages with this command, perhaps you can spot it easily:
    Code:
    pkgutil --pkgs
     
  8. davvanc, Sep 23, 2016
    Last edited: Sep 23, 2016

    davvanc thread starter macrumors member

    Joined:
    Oct 29, 2015
    #8
    Thanks again. The commands seemed to work, at least the errant font now has the same permissions seen for other fonts in the Library using the Command + I method in the finder.
    The "pkgutil --pkgs" command
    shows com.apple.pkg.Essentials among a long list of others; but
    sudo pkgutil --verify com.apple.pkg.Essentials
    produces the following error in Sierra "Unable to run repair_packages(8): launch path not accessible”.
    Anyway, it seems you have solved another one, as the chown and chowd commands worked!
     
  9. KALLT macrumors 601

    Joined:
    Sep 23, 2008
    #9
    Hmm... perhaps pkgutil actually built upon repair_packages. It seems that Apple forgot to remove the parameters from pkgutil. Well then, option 4 is no longer... an option.
     

Share This Page