赞
踩
https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh
国内网络使用下面
homebrew安装脚本下载地址
/bin/bash raw.githubusercontent.com_Homebrew_install_HEAD_install.sh
日志输出内容如下
szlsay@xiaochenyuedeMac-mini Downloads % /bin/bash raw.githubusercontent.com_Homebrew_install_HEAD_install.sh ==> Checking for `sudo` access (which may request your password)... Password: Sorry, try again. Password: ==> This script will install: /opt/homebrew/bin/brew /opt/homebrew/share/doc/homebrew /opt/homebrew/share/man/man1/brew.1 /opt/homebrew/share/zsh/site-functions/_brew /opt/homebrew/etc/bash_completion.d/brew /opt/homebrew Press RETURN/ENTER to continue or any other key to abort: ==> /usr/bin/sudo /usr/sbin/chown -R szlsay:admin /opt/homebrew ==> Downloading and installing Homebrew... HEAD is now at aa2a77b1f Merge pull request #16010 from apainintheneck/improve-versioned-formula-names-performance Warning: /opt/homebrew/bin is not in your PATH. Instructions on how to configure your shell for Homebrew can be found in the 'Next steps' section below. ==> Installation successful! ==> Homebrew has enabled anonymous aggregate formulae and cask analytics. Read the analytics documentation (and how to opt-out) here: https://docs.brew.sh/Analytics No analytics data has been sent yet (nor will any be during this install run). ==> Homebrew is run entirely by unpaid volunteers. Please consider donating: https://github.com/Homebrew/brew#donations ==> Next steps: - Run these two commands in your terminal to add Homebrew to your PATH: (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/szlsay/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)" - Run brew help to get started - Further documentation: https://docs.brew.sh
(echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/szlsay/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
brew help
szlsay@xiaochenyuedeMac-mini ~ % brew help
Example usage:
brew search TEXT|/REGEX/
brew info [FORMULA|CASK...]
brew install FORMULA|CASK...
brew update
brew upgrade [FORMULA|CASK...]
brew uninstall FORMULA|CASK...
brew list [FORMULA|CASK...]
。。。
说明已安装配置完成,可以愉快的使用了~~~
Homebrew 是一款 Mac OS 平台下的软件包管理工具,拥有安装、卸载、更新、查看、搜索等很多实用的功能。官方地址 https://brew.sh/
在终端执行下面指令:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
通常国内访问不到,会出现下面的问题
curl: (35) LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to raw.githubusercontent.com:443
建议解决方法:
https://raw.githubusercontent.com
地址即可sudo mkdir /usr/local/Homebrew
sudo git clone https://mirrors.ustc.edu.cn/brew.git /usr/local/Homebrew
sudo ln -s /usr/local/Homebrew/bin/brew /usr/local/bin/brew
sudo mkdir -p /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
sudo git clone https://mirrors.ustc.edu.cn/homebrew-core.git /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
brew --version
输出以下内容
Homebrew 2.2.17-105-g1aee867
Homebrew/homebrew-core (git revision dd2556; last commit 2020-05-25)
brew update
提示下面错误问题
mkdir: /usr/local/var/homebrew/locks: Permission denied
Error: Can’t create update lock in /usr/local/var/homebrew/locks!
Fix permissions by running:
sudo chown -R $(whoami) /usr/local/var/homebrew
解决方法
sudo mkdir /usr/local/var
sudo mkdir /usr/local/var/homebrew
sudo chown -R $(whoami) /usr/local/var/homebrew
重新更新操作,指令 update
与 up
一样
brew up
输出下面内容,表示成功
Already up-to-date.
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc
macOS Catalina 默认为zsh,如果你使用的是bash,执行下面
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
➜ local brew up
Error: /usr/local/Homebrew is not writable. You should change the
ownership and permissions of /usr/local/Homebrew back to your
user account:
sudo chown -R $(whoami) /usr/local/Homebrew
问题解决:
sudo chown -R $(whoami) /usr/local/Homebrew
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。