Error: Could not link:/usr/local/etc/bash_completion.d/brew

在brew update 或brew install某东东时出现下面的提示

$ brew update

Updated 1 tap (homebrew/core).
==> Updated Formulae
libhttpseverywhere

Error: Could not link:

/usr/local/etc/bash_completion.d/brew


Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/zsh/site-functions/_brew

Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/man/man1/brew-cask.1
/usr/local/share/man/man1/brew.1

Please delete these paths and run `brew update`.
Error: Could not link:
/usr/local/share/doc/homebrew

Please delete these paths and run `brew update`.





解决办法是有几处路径Error 就全部rm  -rf,如下

$ rm -rf /usr/local/share/doc/homebrew

 $ rm -rf /usr/local/share/man/man1/brew-cask.1
 $ rm -rf /usr/local/share/man/man1/brew.1
 $ rm -rf /usr/local/share/zsh/site-functions/_brew
 $ rm -rf /usr/local/etc/bash_completion.d/brew

 $ brew update
Already up-to-date.
macx@macminixdeMac-mini ~ % /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ==> Checking for `sudo` access (which may request your password)... 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 ==> The following new directories will be created: /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks Press RETURN/ENTER to continue or any other key to abort: ==> /usr/bin/sudo /usr/bin/install -d -o root -g wheel -m 0755 /opt/homebrew ==> /usr/bin/sudo /bin/mkdir -p /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> /usr/bin/sudo /bin/chmod ug=rwx /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> /usr/bin/sudo /bin/chmod go-w /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions ==> /usr/bin/sudo /usr/sbin/chown macx /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> /usr/bin/sudo /usr/bin/chgrp admin /opt/homebrew/bin /opt/homebrew/etc /opt/homebrew/include /opt/homebrew/lib /opt/homebrew/sbin /opt/homebrew/share /opt/homebrew/var /opt/homebrew/opt /opt/homebrew/share/zsh /opt/homebrew/share/zsh/site-functions /opt/homebrew/var/homebrew /opt/homebrew/var/homebrew/linked /opt/homebrew/Cellar /opt/homebrew/Caskroom /opt/homebrew/Frameworks ==> /usr/bin/sudo /usr/sbin/chown -R macx:admin /opt/homebrew ==> /usr/bin/sudo /bin/mkdir -p /Users/macx/Library/Caches/Homebrew ==> /usr/bin/sudo /bin/chmod g+rwx /Users/macx/Library/Caches/Homebrew ==> /usr/bin/sudo /usr/sbin/chown -R macx /Users/macx/Library/Caches/Homebrew ==> Downloading and installing Homebrew... fatal: unable to access 'https://github.com/Homebrew/brew/': Error in the HTTP2 framing layer Warning: Trying again in 2 seconds: /usr/bin/git fetch --quiet --progress --force origin fatal: unable to access 'https://github.com/Homebrew/brew/': Failed to connect to github.com port 443 after 75002 ms: Couldn't connect to server Warning: Trying again in 4 seconds: /usr/bin/git fetch --quiet --progress --force origin error: RPC failed; curl 28 Failed to connect to github.com port 443 after 75000 ms: Couldn't connect to server fatal: expected flush after ref listing Warning: Trying again in 8 seconds: /usr/bin/git fetch --quiet --progress --force origin fatal: unable to access 'https://github.com/Homebrew/brew/': Failed to connect to github.com port 443 after 75003 ms: Couldn't connect to server Warning: Trying again in 16 seconds: /usr/bin/git fetch --quiet --progress --force origin remote: Enumerating objects: 301328, done. remote: Counting objects: 100% (14523/14523), done. remote: Compressing objects: 100% (515/515), done. remote: Total 301328 (delta 14162), reused 14052 (delta 14008), pack-reused 286805 (from 6) remote: Enumerating objects: 55, done. remote: Counting objects: 100% (34/34), done. remote: Total 55 (delta 33), reused 33 (delta 33), pack-reused 21 (from 1) ==> Updating Homebrew... ==> Downloading https://ghcr.io/v2/homebrew/portable-ruby/portable-ruby/blobs/sha256:40e7f5d7514a7e9757facdd39006f7a351d3d7986d3a228be13c8b1c3216727b ######################################################################### 100.0% ==> Pouring portable-ruby-3.4.3.arm64_big_sur.bottle.tar.gz 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 commands in your terminal to add Homebrew to your PATH: echo >> /Users/macx/.zprofile echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/macx/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)" - Run brew help to get started - Further documentation: https://docs.brew.sh
最新发布
05-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值