Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

davvanc

macrumors member
Original poster
Oct 29, 2015
56
6
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".
 

AdoTedo

macrumors newbie
Sep 22, 2016
2
0
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".


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

davvanc

macrumors member
Original poster
Oct 29, 2015
56
6
What is the problem you are trying to solve?
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.
 
Last edited:

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
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.
 
Last edited:

davvanc

macrumors member
Original poster
Oct 29, 2015
56
6
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 four 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.
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!
 

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
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
 

davvanc

macrumors member
Original poster
Oct 29, 2015
56
6
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
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!
 
Last edited:

KALLT

macrumors 603
Sep 23, 2008
5,380
3,415
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!

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.