When i install python by brew, it shows error:
cp: /private/tmp/d20221129-9397-882a6m/ca-certificates/./2022-10-11: unable to copy ACL to /usr/local/Cellar/ca-certificates/./2022-10-11: Permission denied
cp: utimensat: /usr/local/Cellar/ca-certificates/.: Permission denied
Error: Failure while executing; `cp -pR /private/tmp/d20221129-9397-882a6m/ca-certificates/. /usr/local/Cellar/ca-certificates` exited with 1. Here's the output:
cp: /usr/local/Cellar/ca-certificates/./2022-10-11: Permission denied
cp: /private/tmp/d20221129-9397-882a6m/ca-certificates/./2022-10-11: unable to copy extended attributes to /usr/local/Cellar/ca-certificates/./2022-10-11: Permission denied
cp: /usr/local/Cellar/ca-certificates/./2022-10-11/.brew: No such file or directory
cp: /private/tmp/d20221129-9397-882a6m/ca-certificates/./2022-10-11/.brew: unable to copy extended attributes to /usr/local/Cellar/ca-certificates/./2022-10-11/.brew: No such file or directory
cp: /usr/local/Cellar/ca-certificates/./2022-10-11/.brew/ca-certificates.rb: No such file or directory
cp: utimensat: /usr/local/Cellar/ca-certificates/./2022-10-11/.brew: No such file or directory
cp: chown: /usr/local/Cellar/ca-certificates/./2022-10-11/.brew: No such file or directory
cp: chmod: /usr/local/Cellar/ca-certificates/./2022-10-11/.brew: No such file or directory
cp: chflags: /usr/local/Cellar/ca-certificates/./2022-10-11/.brew: No such file or directory
cp: /private/tmp/d20221129-9397-882a6m/ca-certificates/./2022-10-11/.brew: unable to copy ACL to /usr/local/Cellar/ca-certificates/./2022-10-11/.brew: No such file or directory
cp: /usr/local/Cellar/ca-certificates/./2022-10-11/share: No such file or directory
cp: /private/tmp/d20221129-9397-882a6m/ca-certificates/./2022-10-11/share: unable to copy extended attributes to /usr/local/Cellar/ca-certificates/./2022-10-11/share: No such file or directory
cp: /usr/local/Cellar/ca-certificates/./2022-10-11/share/ca-certificates: No such file or directory
cp: /private/tmp/d20221129-9397-882a6m/ca-certificates/./2022-10-11/share/ca-certificates: unable to copy extended attributes to /usr/local/Cellar/ca-certificates/./2022-10-11/share/ca-certificates: No such file or directory
cp: /usr/local/Cellar/ca-certificates/./2022-10-11/share/ca-certificates/cacert.pem: No such file or directory
cp: utimensat: /usr/local/Cellar/ca-certificates/./2022-10-11/share/ca-certificates: No such file or directory
cp: chown: /usr/local/Cellar/ca-certificates/./2022-10-11/share/ca-certificates: No such file or directory
cp: chmod: /usr/local/Cellar/ca-certificates/./2022-10-11/share/ca-certificates: No such file or directory
cp: chflags: /usr/local/Cellar/ca-certificates/./2022-10-11/share/ca-certificates: No such file or directory
cp: /private/tmp/d20221129-9397-882a6m/ca-certificates/./2022-10-11/share/ca-certificates: unable to copy ACL to /usr/local/Cellar/ca-certificates/./2022-10-11/share/ca-certificates: No such file or directory
cp: utimensat: /usr/local/Cellar/ca-certificates/./2022-10-11/share: No such file or directory
cp: chown: /usr/local/Cellar/ca-certificates/./2022-10-11/share: No such file or directory
cp: chmod: /usr/local/Cellar/ca-certificates/./2022-10-11/share: No such file or directory
cp: chflags: /usr/local/Cellar/ca-certificates/./2022-10-11/share: No such file or directory
cp: /private/tmp/d20221129-9397-882a6m/ca-certificates/./2022-10-11/share: unable to copy ACL to /usr/local/Cellar/ca-certificates/./2022-10-11/share: No such file or directory
cp: utimensat: /usr/local/Cellar/ca-certificates/./2022-10-11: No such file or directory
cp: chown: /usr/local/Cellar/ca-certificates/./2022-10-11: No such file or directory
cp: chmod: /usr/local/Cellar/ca-certificates/./2022-10-11: No such file or directory
cp: chflags: /usr/local/Cellar/ca-certificates/./2022-10-11: No such file or directory
cp: /private/tmp/d20221129-9397-882a6m/ca-certificates/./2022-10-11: unable to copy ACL to /usr/local/Cellar/ca-certificates/./2022-10-11: Permission denied
cp: utimensat: /usr/local/Cellar/ca-certificates/.: Permission denied
HOW can i fix it and install python with brew? Before that, i was installed node and yarn with brew. I have tried uninstalling it and re-installing brew, but it doesn't work. Thank you!
I had the same issue and managed to fix it the following way:
I saw that the upgrade script tried to copy files from
/private/tmp/d20221130-21318-e53mkn/ca-certificates/./2022-10-11 to /usr/local/Cellar/ca-certificates/./2022-10-11 and I got a Permission denied meaning - I (the current mac user) could not edit/create files there.
So i went to /usr/local/Cellar/ and saw that my user was not the owner of the folder ca-certificates and several others. So i just changed the onwer like this:
cd /usr/local/Cellar/
sudo chown -R REPLACE_WITH_YOUR_USERNAME:admin *
And this fix the issue for me. A simple brew upgrde upgraded all my packages after that.
Hope this helps !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With