macos - Homebrew 安装出现错误
问题描述
在安装自制软件时出现此错误,有人可以解释发生了什么以及解决方案吗?
==> This script will install:
/usr/local/bin/brew
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
/usr/local/Homebrew
Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
fatal: cannot copy '/usr/local/Cellar/git/2.19.1/share/git-core/templates/hooks/fsmonitor-watchman.sample' to '/usr/local/Homebrew/.git/hooks/fsmonitor-watchman.sample':
Permission denied
Failed during: git init -q
解决方案
你必须给 Homebrew 写里面的权利/usr/local
。为此,运行的官方命令是:
cd /usr/local && sudo chown -R $(whoami) bin etc include lib sbin share var opt Cellar Caskroom Frameworks
有关详细信息,请阅读Homebrew的官方故障排除页面。
如果您尚未安装/usr/local
依赖特定权限的应用程序,您还可以运行:
sudo chown -R $(whoami) /usr/local/*
推荐阅读
- python - 如何在 Python 中创建一个函数来确定列表是否已排序?
- python - 从 jupyter notebook 访问外部硬盘中的数据
- python - 有人可以用这个函数解释这种行为吗?
- python - Python中的Cmd日历
- ionic-framework - 我无法使用选项卡表单重定向离子页面
- django - python manage.py createsuperuser 适用于 Mac,但不适用于 windows
- c - 我需要使用 C 创建表,该表从用户那里获取输入,而不使用数组、动态数组或动态内存分配
- python - 为什么我可以在一个 numpy 数组中多次执行“[:]”?
- graph - Gremlin 查询以根据输出顶点的特定子集上的输出边数来选择顶点
- python - 如何将张量中的列表连接到单个列表?