Looking for some guidance on how to fix my permissions on my /usr/bin
directory. I actually recently had a data recovery on my machine where I had to have my whole home directory copied to a new mac.
Upon this I noticed that my old binaries I had in my /usr/local
folder prior to my migrating my data are no longer able to be ran.
I also do not have brew
, and I am unable to install it.
Attempting to chown
/usr/local
also fails
% sudo chown -R "$USER":admin /usr/local
chown: /usr/local: Operation not permitted
This first started happening when I noticed brew is not installed. When I try to install brew, I get the following:
% /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
==> Checking for `sudo` access (which may request your password).
Password:
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
==> The following new directories will be created:
/usr/local/bin
/usr/local/sbin
Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/mkdir -p /usr/local/bin /usr/local/sbin
mkdir: /usr/local/bin: Not a directory
mkdir: /usr/local/sbin: Not a directory
Failed during: /usr/bin/sudo /bin/mkdir -p /usr/local/bin /usr/local/sbin
Here is my ls -aleO@ /usr/local
total 52960
drwxr-xr-x 14 root wheel sunlnk 448 Feb 24 19:19 .
drwxr-xr-x@ 11 root wheel restricted,hidden 352 Feb 18 16:51 ..
com.apple.rootless 0
drwxr-xr-x 2 myuser.user admin - 64 Feb 24 19:19 Caskroom
drwxr-xr-x 2 myuser.user admin - 64 Feb 24 19:19 Cellar
drwxrwxr-x 2 myuser.user admin - 64 Feb 24 19:19 Frameworks
-rwxrwxr-x@ 1 myuser.user admin - 12434524 Feb 23 21:11 bin
com.apple.quarantine 57
drwxrwxr-x 2 myuser.user admin - 64 Feb 24 19:19 etc
drwxr-xr-x 20 myuser.user admin - 640 Feb 16 11:12 go
drwxrwxr-x 2 myuser.user admin - 64 Feb 24 19:19 include
drwxrwxr-x 2 myuser.user admin - 64 Feb 24 19:19 lib
drwxrwxr-x 2 myuser.user admin - 64 Feb 24 19:19 opt
-rwxrwxr-x@ 1 myuser.user admin - 14033312 Feb 23 21:44 sbin
com.apple.quarantine 57
drwxrwxr-x 3 myuser.user admin - 96 Feb 24 19:19 share
drwxrwxr-x 3 myuser.user admin - 96 Feb 24 19:19 var```