bash - sudo chown/usr/bin/local 无法永久用于 Homebrew 软件升级

标签 bash homebrew sysadmin

我已经尝试过 sudo chown $whoami/usr/local/bin ,在关闭终端并重新打开终端后,但它一直被拒绝许可,它不会永久修复它。

shaunstanislaus@Master ~ $ brew upgrade
==> Upgrading 3 outdated packages, with result:
git 2.6.1, mysql 5.6.27, node 4.1.2
==> Upgrading git
Error: Permission denied - /usr/local/share/git-core

最佳答案

您需要更改(更改所有权)/usr/local/bin /usr/local/share, /usr/local/share/man/usr/local/share/man/man1 目录。

为此,您需要执行以下操作:

  1. whoami - 这将为您提供当前的用户名
  2. sudo chown -R 'username'/usr/local/bin/usr/local/share/usr/local/share/man/usr/local/share/man/man1(替换用户名使用步骤 1) 中的用户名

现在运行 brew doctor

您应该看不到任何问题。

然后运行brew upgrade

如果您使用的是 Sophos Anti-Virus,则每次 Sophos 在后台更新时都会重置权限。

他们正在寻求解决此问题的方法,根据此论坛帖子,将于 2015 年 11 月中旬到位:

https://community.sophos.com/products/free-antivirus-tools-for-desktops/f/17/t/10029

关于bash - sudo chown/usr/bin/local 无法永久用于 Homebrew 软件升级,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32975466/

相关文章:

bash - 在新 shell 中运行 bash 命令并在执行此命令后留在新 shell 中

windows - 如何在 bash/ubuntu 下通过 SSH 在 Windows 上使用 hg?

go - 如何通过 Homebrew 软件从 1.4 升级到 1.5

python - 需要帮助在 os x 10.7 上安装 lxml

linux - 如何删除 uid 为 0 的用户?

windows - 从 Get-ChildItem -Path 返回对象数组

apache - 为什么在 NGINX/Cherokee/Lighttpd 上使用 Apache?

git - 子模块的别名

sql - PostgreSQL - 从 bash 脚本查询数据库用户 'postgres'

osx-mountain-lion - Homebrew:brew医生抛出了很多错误,我该如何解决?