CXYVIP官网源码交易平台_网站源码_商城源码_小程序源码平台-丞旭猿论坛
CXYVIP官网源码交易平台_网站源码_商城源码_小程序源码平台-丞旭猿论坛
CXYVIP官网源码交易平台_网站源码_商城源码_小程序源码平台-丞旭猿论坛

homebrew下载git(居然可以这样)homebrew下载软件,HomeBrew下载速度慢?尝试切换到镜像源吧,源码交易平台,

1.homebrew安装git

Homebrew是一款Mac OS平台下的软件包管理工具,拥有安装、卸载、更新、查看、搜索等很多实用的功能简单的一条指令,就可以实现包管理,而不用你关心各种依赖和文件路径的情况,十分方便快捷HomeBrew是一个很棒的仓库,但是由于网络复杂等原因,尝尝无法使用brew下载包文件,本文提供两种国内镜像源,不妨试试。

2.homebrew安装软件

1. 中科大镜像源需要替换为中科大源,请执行以下代码:cd “$(brew –repo)” git remote set-url origin git://github.com/Homebrew/brew cd “$(brew –repo)” git remote set-url origin https://mirrors.ustc.edu.cn/brew.git cd “$(brew –repo)/Library/Taps/homebrew/homebrew-core” git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git cd brew update echo export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles >> ~/.bash_profile source ~/.bash_profile

3.Homebrew下载

2. 清华大学源需要替换为清华大学源,请执行以下代码:cd “$(brew –repo)” git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git cd “$(brew –repo)/Library/Taps/homebrew/homebrew-core” git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git cd brew update echo export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles >> ~/.bash_profile source ~/.bash_profile

4.homebrew可以安装哪些软件

3. 使用homebrew-science或者homebrew-python使用如下代码切换:cd “$(brew –repo)/Library/Taps/homebrew/homebrew-science” git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-science.git cd “$(brew –repo)/Library/Taps/homebrew/homebrew-python” git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-python.git cd brew update

5.homebrew安装

4. 切回官方源有时候,上述中科大源或清华源失效或宕机,需要切换回官方源:首先下载brew_instal文件cd ~ curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install >> brew_install

编辑brew_instal文件HOMEBREW_PREFIX = “/usr/local”.freeze HOMEBREW_REPOSITORY = “/usr/local/Homebrew”.freeze HOMEBREW_CACHE = “#{ENV[“HOME”]}/Library/Caches/Homebrew”.freeze HOMEBREW_OLD_CACHE = “/Library/Caches/Homebrew”.freeze BREW_REPO = “https://github.com/Homebrew/brew”.freeze #BREW_REPO = “git://mirrors.ustc.edu.cn/brew.git”.freeze CORE_TAP_REPO = “https://github.com/Homebrew/homebrew-core”.freeze #CORE_TAP_REPO = “git://mirrors.ustc.edu.cn/homebrew-core.git”.freeze

注释掉:BREW_REPO = “git://mirrors.ustc.edu.cn/brew.git”.freeze CORE_TAP_REPO = “git://mirrors.ustc.edu.cn/homebrew-core.git”.freeze

修改为:BREW_REPO = “https://github.com/Homebrew/brew”.freeze CORE_TAP_REPO = “https://github.com/Homebrew/homebrew-core”.freeze

安装,运行修改了的brew_install文件/usr/bin/ruby ~/brew_install 替换homebrew默认源cd “$(brew –repo)” git remote set-url origin https://github.com/Homebrew/brew.git cd “$(brew –repo)/Library/Taps/homebrew/homebrew-core” git remote set-url origin https://github.com/Homebrew/homebrew-core.git cd brew update 。

在Mac OS X 10.11系统以后,/usr/local/等系统目录下的文件读写是需要系统root权限的,以往的Homebrew安装如果没有指定安装路径,会默认安装在这些需要系统root用户读写权限的目录下,导致有些指令需要添加sudo前缀来执行。

© 版权声明
THE END
喜欢就支持一下吧
点赞0赞赏 分享
相关推荐
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片

    暂无评论内容