Homebrew の権限を修正するには? 質問する

Homebrew の権限を修正するには? 質問する

ほとんどのインストールの最後に権限が拒否されるため、何もインストールできないように思われるため、Homebrew をアンインストールしてインストールを 3 回繰り返しました。

例として、私が現在直面している libjpeg ダウンロード シナリオを投稿します。

libjpeg をインストールしようとすると、次の結果が表示されます。

$ brew install libjpeg
==> Downloading https://downloads.sf.net/project/machomebrew/Bottles/jpeg-8d.mountain_lion.bottle.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/jpeg-8d.mountain_lion.bottle.1.tar.gz
==> Pouring jpeg-8d.mountain_lion.bottle.1.tar.gz
Warning: Could not link jpeg. Unlinking...
Error: The brew link step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link jpeg'
Error: Permission denied - /usr/local/opt/jpeg

「brew link jpeg」の結果

Error: Permission denied - /usr/local/opt/jpeg

私の醸造博士が読むものは次のとおりです

$ brew doctor
Warning: "config" scripts exist outside your system or Homebrew directories.
./configure scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.

Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:

/Library/Frameworks/Python.framework/Versions/2.7/bin/python-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2-config
/Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-config
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run brew link on these:

jpeg

この権限の問題により、brew を何にも使用できなくなっています。ご提案があれば、ぜひお知らせください。

ベストアンサー1

chown次のフォルダーを使用することで問題を解決できました:

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

また、(おそらく) 同じことを次の場合にも行う必要があります/Library/Caches/Homebrew:

sudo chown -R "$USER":admin /Library/Caches/Homebrew

どうやら、私はsudo以前、 のフォルダ権限を変更する方法で使用していたようです/usr/localが、今後は brew を使用したすべてのインストールが成功することが証明されています。

この回答はgitHub の自作問題追跡ツール

おすすめ記事