The command Line would not let me repair my disk permission on Mac (Mojave)

Im on macOS Mojave on my Mac. I deleted my admin and made my user to admin. Now, I have problems with permission of files in the system. Yosemite was able to repair disk permissions by pressing a button. On the new system you must use the command line. I just got error when I tried to repair it. By the way, I'm uid 501.

sudo /usr/libexec/repair_packages --verify --standard-pkgs /
sudo: /etc/sudoers is owned by uid 501, should be 0
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

Solution 1:

That command no longer exists since Sierra.

Apple recommend this as the current way to repair user permissions...

From Apple KB - Resolve issues caused by changing the permissions of items in your home folder

Reset permissions

If the issue started after changing the permissions of items in your home folder, reset permissions:

  1. From the Finder menu bar, choose Go > Home. Your home folder opens.
  2. Choose File > Get Info. An Info window for your home folder opens.
  3. If the Sharing & Permissions section at the bottom of the window isn't open, click the triangle in that section to open it.
  4. If the Lock button at the bottom of the window shows a closed lock lock , click the lock and enter an administrator name and password.
  5. Click the Action menu in the bottom corner of the window, then choose “Apply to enclosed items.” Click OK to confirm the action. A progress bar appears at the top of the window.

  1. When the progress bar completes, open the Terminal app, which is in the Utilities folder of your Applications folder.
  2. Paste or type this command in Terminal, then press Return:

    diskutil resetUserPermissions / `id -u\`

On U.S. keyboards, the ` character is just above the Tab key. After entering the diskutil command, if Terminal says that permissions reset on user home directory failed (error -69841), enter chflags -R nouchg ~ then enter the diskutil command again.

  1. When the process completes, quit Terminal.
  2. Restart the computer, then test to see if the issue is fixed.
  3. If the issue persists, reinstall macOS.