かすみん日記

暇なときに何か喋ります

【Homebrew】Error: Permission denied @ apply2files - /usr/local/[略]

環境

  • mac (Catalina)

症状と解決

Homebrewで brew cleanup を実行するとエラーが出た。

% brew cleanup
略
Error: Permission denied @ apply2files - /usr/local/share/ghostscript/9.19/Resource/CIDFSubst/AppleGothic.ttf

権限(グループ?)を確認してみると、 wheel となっていた。

% ls -al /usr/local/share
略
drwxrwxr-x    4 root    wheel   128 11  7 21:18 ghostscript/
略

この wheeladmin に直してあげるといいらしい。

sudo chown -R "$USER":admin /usr/local/share/ghostscript/

もう一度、権限(グループ?)を確認してみると、ちゃんと admin になった。

% ls -al /usr/local/share                                  
略
drwxrwxr-x    4 atsuki  admin   128 11  7 21:18 ghostscript/
略

これでもう brew cleanup してもエラーが出なくなった。

参考

chick307.hatenablog.com

www.d-wood.com