Search code examples
macospermissionsappiumhomebrewchown

Chown failure on Mac when attempting to install mobile device drivers for Appium via homebrew


After Appium did not recognize uid, I tried installing it with this command:

brew install libimobiledevice --HEAD

That gave me the following error:

Error: /usr/local/Homebrew is not writable. You should change the
ownership and permissions of /usr/local/Homebrew back to your
user account:
sudo chown -R $(whoami) /usr/local/Homebrew
Error: Permission denied @ rb_sysopen - > 
/usr/local/var/homebrew/locks/libimobiledevice.formula.lock

So, i copypastad and ran that chown command. It does not complain and seems to run. But, when I run the first command again, I still get the same error message.

Could someone help me resolve this?

edit: I ran this command: ls -ld /usr/local/Homebrew

This was the output: drwxr-xr-x 17 1791192515 wheel 544 Mar 2 12:08 /usr/local/Homebrew

I ran this command: ls -l /usr/local/var/homebrew/locks/libimobiledevice.formula.lock

This was the output: No such file or directory


Solution

  • these are the steps I took to solve this problem

    sudo chown -R "$USER":admin /usr/local then: sudo chown -R "$USER":admin /Library/Caches/Homebrew then: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" Before trying again to run: brew install libimobiledevice --HEAD