更新时间:2022-04-19 22:51:01
切勿将sudo
与命令brew
一起使用.它将破坏相关文件的所有权.不支持以root用户身份运行brew
.
tl; dr Sudo很危险,您始终没有安装sudo就安装了TextMate.app.
tl;dr Sudo is dangerous, and you installed TextMate.app without sudo anyway.
自制软件拒绝使用sudo
工作.
Homebrew refuses to work using sudo
.
check-run-command-as-root() {
...
odie <<EOS
Running Homebrew as root is extremely dangerous and no longer supported.
As Homebrew does not drop privileges on installation you would be giving all
build scripts full access to your system.
EOS
}
禁用该服务并删除启动守护程序.
Disable the service and remove the launchdaemon.
# stop and unload the launchdaemon
sudo launchctl unload -w /Library/LaunchDaemons/homebrew.mxcl.mysql.plist
# remove the lauchdaemon file
sudo rm -f /Library/LaunchDaemons/homebrew.mxcl.mysql.plist
sudo rm -f /tmp/mysql.sock /tmp/mysqlx.sock
修复/usr/local/
sudo chown -R "$(whoami):admin" /usr/local/*
# it will take some time
重新启用MySQL服务.
Re-enable the MySQL service.
# DO NOT USE "sudo brew"
brew services start mysql
最后,大声朗读以下单词:我再也不会将sudo
与brew
一起使用了.
At last, read the following words aloud: I'll never use sudo
with brew
again.