16

macOS El Capitan (10.11) is unable to install any software updates or install any software because the /tmp and the /private/tmp folders don't seem to be writeable.

Running this:

sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume /

Gives me this error:

unable to set owner and group on "tmp" Error 1 Operation not permitted
unable to set permissions on "tmp" Error 1 Operation not permitted

Is there a way to manually delete the tmp folders and recreate them? When I tried renaming or deleting /tmp or /private/tmp I kept getting operation not permitted. sudo chmod 1777 also failed in the same way on both /tmp and /private/tmp folders

Disk Utility says the disk is healthy with no issues detected when running first aid.

Is there any way to redirect the tmp location to another writeable folder?

Giacomo1968
  • 58,727
Ali
  • 1,219

5 Answers5

29
  1. Reboot your Mac into recovery mode
  2. Open Utilities menu in the top bar > open Terminal

    csrutil disable
    
  3. Reboot

  4. Remove the tmp folder

    sudo rm -i /tmp
    sudo rm -i /private/tmp
    
  5. Create tmp folder

    sudo mkdir /private/tmp
    sudo chown root:wheel /private/tmp
    sudo chmod 1777 /private/tmp
    
  6. Create the symlink

    sudo ln -s /private/tmp /tmp
    
  7. Run repair_packages (you may not need to do this)

    sudo /usr/libexec/repair_packages --repair --standard-pkgs --volume /
    
  8. Reboot back to recovery mode and run

    csrutil enable
    
  9. Reboot


Props to Andrew Ferk for figuring out a fix; pulling out your comment as a community wiki answer so it's more readable.

yairchu
  • 1,955
ento
  • 256
11
sudo chmod 1777 /private/tmp

Did it for me.

Renetik
  • 213
0

I fixed this by restoring my system from a Time Machine Backup. But the other suggestions in the comments are worth trying too.

Ali
  • 1,219
0

If you got this message in terminal (or iTerm) using maxOS Mojave

Operation not permitted

It turned out I needed to add my terminal app to the Settings.app "Security & Privacy" > "Full Disk Access"
(I added both terminal.app and iTerm.app)

-1

Try to create and modify permissions on /private/tmp folder without running csrutil disable. This worked for me, after trying unsuccessfully to delete and the error message on boot is gone.

kenorb
  • 26,615