MAC brew下载报错
· 阅读需 2 分钟
MAC brew下载报错
编译 wget 报错
configure: error: in `/Users/macbook/Software/wget-1.21.2':
configure: error: The pkg-config script could not be found or is too old. Make sure it
is in your PATH or set the PKG_CONFIG environment variable to the full
path to pkg-config.
Alternatively, you may set the environment variables OPENSSL_CFLAGS
and OPENSSL_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
To get pkg-config, see <http://pkg-config.freedesktop.org/>.
See `config.log' for more details
尝试下载相关依赖,和使用--with=openssl 都没有解决
解决方案
# 更换 brew 源,将 brew 默认的 github 源更换为阿里源解决:
使用 阿里云 的 Homebrew 镜像源进行加速
执行 brew 命令安装应用的时候,跟以下 3 个仓库地址有关:
- brew.git
- homebrew-core.git
- homebrew-bottles
更换 brew.git
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
更换 homebrew-core.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
更换 homebrew-bottles
这与当前 macOS 系统使用的 shell 版本有关系,执行以下命令查看 Shell版本:
echo $SHELL
# 根据版本不同,会输出2种结果,/bin/zsh 或 /bin/bash,根据类型进行操作即可
- /bin/zsh 结果
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
- /bin/bash 结果
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
再次下载 wget
brew install wget
# yeah~ sccuess