Brew is similar to apt-get and yum package manager is a OS X,,It relies on Github ..................
so,While you are lucky enough to be downloaded to the brew,But you certainly can not update the brew。Cause you know。However, although it can not update brew,But this only refers to brew the manager itself Bale,Or software that can be installed。However, due to not use brew update Will not be able to update the software ...... we need to change source to brew。
Update
note,If you followLet go Homebrew Update AgentThe article to operate the,Then you do not need to switch the image source,As it has been a global proxy,Otherwise it will lead to brew can not be updated - because foreign country can not easily access。
If you do both,Then you need to use the following command to reinstall brew :
1 2 3 |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" |
brew mirror source
brew also mirroring? Ok,Indeed, some,And not just one:
- USTC brew mirroring
- Tsinghua brew mirroring
Replace mirroring
1 2 3 4 5 6 |
cd /usr/local git remote set-url origin git://mirrors.tuna.tsinghua.edu.cn/homebrew.git //清华镜像源 git remote set-url origin http://mirrors.ustc.edu.cn/homebrew.git //中科大镜像源 //二者选其一即可更新 |
Next Steps
1 2 3 4 5 6 7 8 9 10 11 |
cd ~ mkdir tmp cd tmp //以下要与你选择的镜像源相同 git clone git://mirrors.tuna.tsinghua.edu.cn/homebrew.git git clone http://mirrors.ustc.edu.cn/homebrew.git sudo rm -rf /usr/local/.git sudo rm -rf /usr/local/Library sudo cp -R homebrew/.git /usr/local/ sudo cp -R homebrew/Library /usr/local/ |
Troubleshooting
If you are experiencing this problem ...:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
╰─➤ brew update Stashing your changes: M .gitignore M .yardopts M README.md M share/doc/homebrew/Acceptable-Formulae.md M share/doc/homebrew/Common-Issues.md M share/doc/homebrew/FAQ.md M share/doc/homebrew/Formula-Cookbook.md M share/doc/homebrew/Homebrew-0.9.3.md M share/doc/homebrew/How-To-Open-a-Homebrew-Pull-Request-(and-get-it-merged).md D share/doc/homebrew/How-to-Create-and-Maintain-a-Tap.md M share/doc/homebrew/How-to-build-software-outside-Homebrew-with-Homebrew-keg-only-dependencies.md M share/doc/homebrew/Installation.md M share/doc/homebrew/Interesting-Taps-&-Branches.md M share/doc/homebrew/Maintainer-Guidelines.md M share/doc/homebrew/Press.md M share/doc/homebrew/Python-for-Formula-Authors.md M share/doc/homebrew/Querying-Brew.md M share/doc/homebrew/README.md D share/doc/homebrew/Rename-A-Formula.md M share/doc/homebrew/Troubleshooting.md M share/doc/homebrew/Xcode.md M share/doc/homebrew/brew-tap.md M share/man/man1/brew.1 fatal: Unable to create '/usr/local/.git/index.lock': Permission denied Cannot save the current index state Error: Failure while executing: git stash save --include-untracked --quiet |
Ann then according to the following command Troubleshooting:
1 2 3 4 |
sudo chgrp -R admin /usr/local //确保目录归属管理组 sudo chmod -R g+w /usr/local //确保管理组可读 |
At last
Gone,run brew update Be happy to update it! then brew upgrade 。?
Further reading
Original article written by LogStudio:R0uter's Blog » Slow brew update image update source solutions
Reproduced Please keep the source and description link:https://www.logcg.com/archives/1301.html
Sometimes it does not work well,USTC's still OK with the:
1. Alternatively homebrew-core source
cd “$(brew –repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git
2. Replace Homebrew Bottles source
echo ‘export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles’ >> ~/.bash_profile
source ~/.bash_profile
brew update
Hang a ladder,I use the accelerator day road,Tell me what network tutorial then fly https://91tianlu.cn/knowledgebase.php?action=displayarticle&id=7
Hang a ladder,I use the accelerator day road,Tell me what network tutorial then fly https://91tianlu.com/knowledgebase.php?action=displayarticle&id=7
In fact, agents will be able to hang,Recommended Tin Road Accelerator。I have been using,Good speed。
In fact, a handy ladder hanging on the line。I have been using the accelerator Tin Road,Official online tutorial,It is how the command-line terminal open proxy
Hello there,I use two mirroring replace command after the error are shown below:
fatal: Not a git repository (or any of the parent directories): .git
How can we solve?
solved,brew built automatically find the repo path method
cd “$(brew –repo)”
Instead of usr / bin / local / can
could not lock config file .git/config: Permission denied in front have not encountered problems,The above problems brew after update
sudo chgrp -R admin /usr/local
//Make sure the directory management group home
sudo chmod -R g+w /usr/local
//Ensure that the management group readable
Run brew update,The following error message,Where this brew.sh in?
/usr/local/bin/brew: line 25: /usr/local/Library/brew.sh: No such file or directory
mine /usr/local/Library/brew.sh It does exist,It seems that you brew bad? Reinstall it。
could not lock config file .git/config: Permission denied in front have not encountered problems,The above problems brew after update