"afni: command not found" after following installation instructions

Hello! I am trying to install AFNI on my MacBook pro Ventura 13.6.6, and am following the instructions for the 'macOS 12+ Intel processor/chip' installation, with the setup for general users. Unfortunately I am running into some issues that I am unsure on how to solve.

When I run 'zsh OS_notes.macos_12_intel_a_admin_pt1.zsh', all seems to go well until I get a very large chunk of red text saying:

cp: utimensat: /usr/local/Cellar/ca-certificates/.: Permission denied

Error: Failure while executing; /usr/bin/env cp -pR /private/tmp/homebrew-unpack20240502-4216-ugpkx0/ca-certificates/. /usr/local/Cellar/ca-certificates exited with 1. Here's the output:

cp: /usr/local/Cellar/ca-certificates/./2024-03-11: Permission denied

cp: /private/tmp/homebrew-unpack20240502-4216-ugpkx0/ca-certificates/./2024-03-11: unable to copy extended attributes to /usr/local/Cellar/ca-certificates/./2024-03-11: Permission denied

cp: /usr/local/Cellar/ca-certificates/./2024-03-11/.brew: No such file or directory

cp: /private/tmp/homebrew-unpack20240502-4216-ugpkx0/ca-certificates/./2024-03-11/.brew: unable to copy extended attributes to /usr/local/Cellar/ca-certificates/./2024-03-11/.brew: No such file or directory

cp: /usr/local/Cellar/ca-certificates/./2024-03-11/.brew/ca-certificates.rb: No such file or directory

cp: utimensat: /usr/local/Cellar/ca-certificates/./2024-03-11/.brew: No such file or directory

cp: chown: /usr/local/Cellar/ca-certificates/./2024-03-11/.brew: No such file or directory

cp: chmod: /usr/local/Cellar/ca-certificates/./2024-03-11/.brew: No such file or directory

cp: chflags: /usr/local/Cellar/ca-certificates/./2024-03-11/.brew: No such file or directory

cp: /private/tmp/homebrew-unpack20240502-4216-ugpkx0/ca-certificates/./2024-03-11/.brew: unable to copy ACL to /usr/local/Cellar/ca-certificates/./2024-03-11/.brew: No such file or directory

cp: /usr/local/Cellar/ca-certificates/./2024-03-11/share: No such file or directory

cp: /private/tmp/homebrew-unpack20240502-4216-ugpkx0/ca-certificates/./2024-03-11/share: unable to copy extended attributes to /usr/local/Cellar/ca-certificates/./2024-03-11/share: No such file or directory

cp: /usr/local/Cellar/ca-certificates/./2024-03-11/share/ca-certificates: No such file or directory

cp: /private/tmp/homebrew-unpack20240502-4216-ugpkx0/ca-certificates/./2024-03-11/share/ca-certificates: unable to copy extended attributes to /usr/local/Cellar/ca-certificates/./2024-03-11/share/ca-certificates: No such file or directory

cp: /usr/local/Cellar/ca-certificates/./2024-03-11/share/ca-certificates/cacert.pem: No such file or directory

cp: utimensat: /usr/local/Cellar/ca-certificates/./2024-03-11/share/ca-certificates: No such file or directory

cp: chown: /usr/local/Cellar/ca-certificates/./2024-03-11/share/ca-certificates: No such file or directory

cp: chmod: /usr/local/Cellar/ca-certificates/./2024-03-11/share/ca-certificates: No such file or directory

cp: chflags: /usr/local/Cellar/ca-certificates/./2024-03-11/share/ca-certificates: No such file or directory

cp: /private/tmp/homebrew-unpack20240502-4216-ugpkx0/ca-certificates/./2024-03-11/share/ca-certificates: unable to copy ACL to /usr/local/Cellar/ca-certificates/./2024-03-11/share/ca-certificates: No such file or directory

cp: utimensat: /usr/local/Cellar/ca-certificates/./2024-03-11/share: No such file or directory

cp: chown: /usr/local/Cellar/ca-certificates/./2024-03-11/share: No such file or directory

cp: chmod: /usr/local/Cellar/ca-certificates/./2024-03-11/share: No such file or directory

cp: chflags: /usr/local/Cellar/ca-certificates/./2024-03-11/share: No such file or directory

cp: /private/tmp/homebrew-unpack20240502-4216-ugpkx0/ca-certificates/./2024-03-11/share: unable to copy ACL to /usr/local/Cellar/ca-certificates/./2024-03-11/share: No such file or directory

cp: utimensat: /usr/local/Cellar/ca-certificates/./2024-03-11: No such file or directory

cp: chown: /usr/local/Cellar/ca-certificates/./2024-03-11: No such file or directory

cp: chmod: /usr/local/Cellar/ca-certificates/./2024-03-11: No such file or directory

cp: chflags: /usr/local/Cellar/ca-certificates/./2024-03-11: No such file or directory

cp: /private/tmp/homebrew-unpack20240502-4216-ugpkx0/ca-certificates/./2024-03-11: unable to copy ACL to /usr/local/Cellar/ca-certificates/./2024-03-11: Permission denied

cp: utimensat: /usr/local/Cellar/ca-certificates/.: Permission denied

Everything seems fine when I run 'zsh OS_notes.macos_12_intel_a_admin_pt2.zsh'

I then get this message when I run 'tcsh OS_notes.macos_12_intel_b_user.tcsh':

/Users/amyaddlesee/abin/init_user_dotfiles.py -shell_list bash zsh tcsh -do_updates path apsearch -dir_bin /Users/amyaddlesee/abin

env: python: No such file or directory

Does anyone know what the problem is? Any advice would be great, thank you!

It looks like you don't own the Cellar or a related directory. Did you previously install homebrew as root or as a different user?
What is the output of:

whoami
ls -ld /usr/local/Cellar
ls -ld /usr/local/Cellar/ca-certificates
  • rick

Hi Rick,

Ah I see, yes perhaps, as I have just taken on this laptop from an old colleague. The output from your suggestion is:

amyaddlesee@macbookpro17 ~ % whoami
ls -ld /usr/local/Cellar
ls -ld /usr/local/Cellar/ca-certificates
amyaddlesee
drwxrwxr-x  29 *old colleague*  admin  928  2 Mai 10:47 /usr/local/Cellar
drwxr-xr-x  3 *old colleague*  admin  96 22 Feb  2023 /usr/local/Cellar/ca-certificates

Do I need to access his account in some way to change anything?

Thank you so much!

It might be enough to change ownership, though uninstalling it might be better (since I believe it installs some details under the $HOME directory, which might point to OLD_COLLEAGUE). You could first try with permissions:

sudo find /usr/local -user OLD_COLLEAGUE -exec chown amyaddlesee {} \;

Then try installing again.
Otherwise you will probably need to try uninstall-homebrew.

  • rick