Use a domestic mirror to install homebrew under Mac

Source: Internet
Author: User
Tags curl install homebrew



According to the method on the official website, enter in the terminal:


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


The result is still stuck in the download phase, how to do? So the internet search for "Homebrew installation Method (The official method is always installed failure) Third party" this article.



Install as described in the article. Since the official abandoned the old homebrew warehouse, the homebrew program and package were split into two warehouses. does not match the description in the article, and it failed to install successfully. So I made a slight change and recorded it here.


Mirror of the country

New Brew.git and Homebrew-core.git images

Since the official abandoned the old homebrew warehouse, the homebrew program and package were split into two warehouses. In order to ensure the normal upgrade of the user, the old image will be temporarily retained for a period of time, the selective deletion.

Warehouse Correspondence Relationship:

Github.com/homebrew/brew-Mirrors.ustc.edu.cn/brew.git
Github.com/homebrew/homebrew-core-Mirrors.ustc.edu.cn/homebrew-core.git
Github.com/homebrew/homebrew (deprecated), mirrors.ustc.edu.cn/homebrew.git

Citation: New Brew.git and Homebrew-core.git mirrors

Install to get the install file and edit
cd ~curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install


Edit Brew_install File


#!/system/library/frameworks/ruby.framework/versions/current/usr/bin/ruby# This script installs to/usr/local only. To install elsewhere can just# untar https://github.com/Homebrew/brew/tarball/master anywhere you like Or# Change the value of Homebrew_prefix. Homebrew_prefix = "/usr/local". Freezehomebrew_repository = "/ Usr/local/homebrew ". Freezehomebrew_cache = " #{ENV[ "HOME"]}/library/caches/homebrew ". Freezehomebrew_old_cache = "/Library/ Caches/homebrew ". Freeze #BREW_REPO =" Https://github.com/Homebrew/brew ". Freezebrew_ REPO = "Git://mirrors.ustc.edu.cn/brew.git". Freeze #CORE_TAP _repo = "Https://github.com/Homebrew/homebrew-core". Freezecore_tap_repo = "git:// Mirrors.ustc.edu.cn/homebrew-core.git ". Freeze          



Comment outBREW_REPO = "https://github.com/Homebrew/brew".freezeandCORE_TAP_REPO = "https://github.com/Homebrew/homebrew-core".freeze



Modified toBREW_REPO = "git://mirrors.ustc.edu.cn/brew.git".freezeandCORE_TAP_REPO = "git://mirrors.ustc.edu.cn/homebrew-core.git".freeze


Installation


Run the modified Brew_install file.


Replace homebrew source


Replace homebrew default Source


cd "$(brew --repo)"git remote set-url origin git://mirrors.ustc.edu.cn/brew.git


Replace Homebrew-core source


cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git
Brew Update
brew update
Setting up Bintray Mirroring
echo ‘export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles‘ >> ~/.bash_profilesource ~/.bash_profile




The little magic cobalt of the girl.
Links: https://www.jianshu.com/p/6523d3eee50d



Use a domestic mirror to install homebrew under Mac


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.