如何修复自制软件权限? [英] How to fix homebrew permissions?

查看:23
本文介绍了如何修复自制软件权限?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在已经卸载并安装 Homebrew 3 次,因为它似乎从不允许我安装任何东西,因为它在大多数安装结束时拒绝我的权限.

I have uninstalled and installed Homebrew 3 times now because it seems to never allow me to install anything as it denies me permissions at the end of most installations.

作为一个例子,我将发布我目前面临的这个 libjpeg 下载场景.

As an example I will post this libjpeg download scenario that I'm currently facing.

我尝试安装 libjpeg 并得到:

I try to install libjpeg and get:

$ 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' 结果为

'brew link jpeg' results in

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

这是我的 brew 医生阅读的内容

Here is what my brew doctor reads

$ 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,我非常感谢任何建议.

This permission issue has been making it impossible to use brew on anything and I would really appreciate any suggestions.

推荐答案

我能够通过在文件夹上使用 chown 来解决问题:

I was able to solve the problem by using chown on the folder:

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

你也(很可能)必须在 /Library/Caches/Homebrew 上做同样的事情:

Also you'll (most probably) have to do the same on /Library/Caches/Homebrew:

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

显然我之前使用过 sudo 的方式改变了我对 /usr/local 的文件夹权限,从这里开始,所有使用 brew 的安装都被证明是成功的.

Apparently I had used sudo before in a way that altered my folder permission on /usr/local, from here on forward all installations with brew have proven to be successful.

这个答案来自 gitHub 的自制问题跟踪器

这篇关于如何修复自制软件权限?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆