mac系统升级到10.12后homebrew不能正常使用的问题

本文针对Homebrew更新后可能出现的问题提供了解决方案,包括调整环境变量、重新链接软件包以及清理未使用的头文件等内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

新的系统更新后对一些重要目录的权限进行了限制,原先安装的homebrew可能会出现一些问题
附上一条安装homebrew命令

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

可尝试用这句话更改权限

sudo chown -R $(whoami):admin /usr/local

1.
这个问题出现的原因是,

Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so
  echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile
BasildeMacBook:~ Basil$ vim ~/.bash_profile

可以通过配置环境变量来解决,在.bash_profile,加入这条数据

export PATH="/usr/local/sbin:$PATH"

然后

source ~/.bash_profile

2.

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:
  aria2
  maven
  pkg-config
  wget
  xz

解决办法:重新建立brew 和软件之间的关联

BasildeMacBook:~ Basil$ brew link maven
Linking /usr/local/Cellar/maven/3.3.9... 0 symlinks created
BasildeMacBook:~ Basil$ brew link pkg-config
Linking /usr/local/Cellar/pkg-config/0.29.1_1... 2 symlinks created
BasildeMacBook:~ Basil$ brew link pkg-config
Warning: Already linked: /usr/local/Cellar/pkg-config/0.29.1_1
To relink: brew unlink pkg-config && brew link pkg-config
BasildeMacBook:~ Basil$ brew link wget
Linking /usr/local/Cellar/wget/1.18... 0 symlinks created
BasildeMacBook:~ Basil$ brew link sz

3.

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
  /usr/local/include/node/android-ifaddrs.h
  /usr/local/include/node/ares.h
  /usr/local/include/node/ares_version.h
  /usr/local/include/node/libplatform/libplatform.h
  /usr/local/include/node/nameser.h
  /usr/local/include/node/node.h
  /usr/local/include/node/node_buffer.h
  /usr/local/include/node/node_object_wrap.h
  /usr/local/include/node/node_version.h
  /usr/local/include/node/openssl/aes.h
  /usr/local/include/node/openssl/archs/aix-gcc/opensslconf.h
  /usr/local/include/node/openssl/archs/aix64-gcc/opensslconf.h
  /usr/local/include/node/openssl/archs/BSD-x86/opensslconf.h
  /usr/local/include/node/openssl/archs/BSD-x86_64/opensslconf.h

解决办法:
删除这些文件

rm -rf /usr/local/include/node  (注意:要慎用rm -rf命令)
Last login: Sat Jun 21 20:42:32 on ttys000 huangzongqian@huangzongqiandeMacBook-Pro ~ % brew tap probezy/core && brew install cpolar ==> Auto-updating Homebrew... Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). ==> Fetching probezy/core/cpolar ==> Downloading https://www.cpolar.com/static/downloads/releases/3.3.18/cpolar-s Already downloaded: /Users/huangzongqian/Library/Caches/Homebrew/downloads/3695a11b9f9ff6dec163b72430411aab72ce3e4b5b16c2d9a7bbd19c2a2fd783--cpolar-stable-darwin-arm64.zip ==> Installing cpolar from probezy/core Warning: A newer Command Line Tools release is available. Update them from Software Update in System Settings. If that doesn't show you any updates, run: sudo rm -rf /Library/Developer/CommandLineTools sudo xcode-select --install Alternatively, manually download them from: https://developer.apple.com/download/all/. You should download the Command Line Tools for Xcode 15.2. This is a Tier 2 configuration: https://docs.brew.sh/Support-Tiers#tier-2 Do not report any issues to Homebrew/* repositories! Read the above document instead before opening any issues or PRs. 🍺 /opt/homebrew/Cellar/cpolar/3.3.18: 4 files, 18.9MB, built in 0 seconds ==> Running `brew cleanup cpolar`... Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`). huangzongqian@huangzongqiandeMacBook-Pro ~ %
最新发布
06-22
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值