【问题标题】:sudo chown /usr/bin/local not working permanently for homebrew upgradesudo chown /usr/bin/local 不能永久用于自制升级
【发布时间】:2015-10-06 16:55:28
【问题描述】:

我试过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

【问题讨论】:

  • 除了使用sudo chown $whoami /usr/local/bin之外,有谁知道如何永久解决它?
  • 请比较whoamiecho $whoamiecho $(whoami)的输出
  • 您在使用 Sophos Anti Virus 吗?
  • @bfontaine 我遇到了同样的问题,是的,我正在使用 Sophos Anti Virus。我想知道 Sophos 是否会在每次重启后覆盖权限或类似情况?

标签: bash homebrew sysadmin


【解决方案1】:

您需要 chown(更改所有权)/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

【讨论】:

  • 或者,如果您在 /usr/local 中没有其他内容会受到不利影响,则只需 sudo chown -R $(whoami) /usr/local
猜你喜欢
  • 2015-08-05
  • 2014-08-05
  • 2014-04-28
  • 1970-01-01
  • 2013-04-22
  • 2021-03-25
  • 2018-01-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多