➜ ~ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
-e:77: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040677
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are bin CODEOFCONDUCT.md etc git lib Library LICENSE.txt munki README.md sbin share .git .github .gitignore
➜ ~ brew install maven
zsh: command not found: brew
当前回答
如果您使用的是WSL2,请确保遵循linuxbrew的最终linux安装说明。
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
其他回答
你的电脑上已经安装了自制软件。你需要像这样修改你的PATH:
export PATH=/usr/local/bin:$PATH
或者从起始点执行brew:
/usr/local/bin/brew install maven
在Apple M1的fish shell中,我必须将/opt/homebrew/bin添加到fish_user_paths全局环境中。我必须手动这样做,因为set -U fish_user_paths /opt/homebrew/bin $fish_user_paths got
设置:通用变量fish_user_paths被同名的全局变量遮蔽。
确保先安装brew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
在您的.zshrc文件中,将路径添加到您的homebrew/bin,无论它可能在哪里。在我的例子中,homebrew安装在我的主目录中。 添加:
export PATH="/<path-to-homebrew-directory>/bin:$PATH"
重新启动终端,让它接收到.zshrc的更改
请访问Homebrew官方网站。
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
下一个步骤:
test -d ~/.linuxbrew && eval $(~/.linuxbrew/bin/brew shellenv)
test -d /home/linuxbrew/.linuxbrew && eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
test -r ~/.bash_profile && echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.bash_profile
echo "eval \$($(brew --prefix)/bin/brew shellenv)" >>~/.profile
尝试:brew install hello
推荐文章
- 为什么cURL返回错误“(23)Failed writing body”?
- 节点和错误:EMFILE,打开的文件太多
- 如何使用命令行工具为Mac OS X创建一个漂亮的DMG ?
- 由于环境错误无法安装包:[Errno 13]
- Mac压缩没有__MACOSX文件夹?
- 提交指定文件
- 如何复制一个选择到OS X剪贴板
- 我如何知道哪些自制配方是可升级的?
- 如何在Mac上设置我的默认shell,例如Fish?
- "ERROR:root:code for hash md5 was not found"当使用任何hg mercurial命令时
- 如何在Linux虚拟机的控制台中上下滚动
- Linux相当于Mac OS X的“open”命令
- 如何在Mac上的命令行安装JQ ?
- 在Mac OS X上安装/升级gradle
- 如何在终端中提高光标速度?