homebrew如何设置
时间: 2024-05-18 08:13:43 浏览: 116
homebrew-autoupdate:自动更新自制程序的简便方法
要设置Homebrew,你可以按照以下步骤进行操作:
1. 重置Homebrew的源:你可以自己创建一个.bashrc或.bash_profile文件,并在其中添加以下命令来重置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 --repo)/Library/Taps/homebrew/homebrew-cask"
git remote set-url origin https://github.com/Homebrew/homebrew-cask.git
```
2. 设置代理:如果你需要使用代理来访问Homebrew,你可以根据自己的代理配置进行设置。
3. 替换为中科大源:如果你希望使用中国科学技术大学的源,你可以按照以下步骤进行操作:
```
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 --repo)/Library/Taps/homebrew/homebrew-cask"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
```
4. 替换Homebrew Bottles源:你可以在.bashrc或者.zshrc文件的末尾添加以下命令来替换Homebrew Bottles源:
```
export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
```
通过按照这些步骤来设置Homebrew,你就可以使用自定义的源和代理来满足你的需求。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [homebrew代理设置](https://blog.csdn.net/weixin_30565327/article/details/99624851)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [Mac homebrew 设置开机自启 Mysql 等各种软件](https://blog.csdn.net/telltao/article/details/114993010)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文