• 导航 (返回顶部)

    • 1. homebrew介绍

      • 1.1 简介
      • 1.2 争议
      • 1.3 数据采集
    • 2. 安装
      • 2.1 Homebrew默认安装目录
      • 2.2 官网安装脚本
      • 2.3 国内安装脚本
      • 2.4 使用科大源安装
    • 3. 修改源
      • 3.1 查看当前源
      • 3.2 修改为阿里源
      • 3.3 替换为清华源
      • 3.4 替换为中科大源
      • 3.5 腾讯源
      • 3.6 重置为官方源
    • 4. 使用homebrew
    • 5. 软件列表
1. homebrew介绍
1.1 简介
1.2 争议
1.3 数据采集
2. 安装
2.1 Homebrew默认安装目录
2.2 官网安装脚本
2.3 国内安装脚本
2.4 使用科大源安装
3. 修改源
3.1 查看当前源
3.2 修改为阿里源
3.3 替换为清华源
3.4 替换为中科大源
3.5 腾讯源
3.6. 重置为官方源
4. 使用homebrew
5. 软件列表

1. homebrew介绍

1.1 简介

https://en.wikipedia.org/wiki/Homebrew_(package_manager)
https://zh.wikipedia.org/wiki/Homebrew
Homebrew 是一个免费的开源软件包管理系统,可以简化软件在Apple的 macOS 和 Linux 上的安装。  
包管理器最初由 Max Howell 编写。Homebrew 是 Software Freedom Conservancy 的非营利项目成员,完全由无偿志愿者运营。
安装包含一个 git 存储库,允许用户通过从 GitHub 拉取更新的存储库来更新 Homebrew。 

1.2 争议

Homebrew 修改了 /usr/local 的默认权限; 具体来说,模式从 drwxr-xr-x root wheel 更改为 drwxrwxr-x myuser admin。  
安装程序更改了所有文件(不仅仅是目录)的所有权。  一些人认为这是一个主要的安全漏洞。
rwx r-x r-x root wheel
rwx rwx r-x myuser admin
用户   其他
用户
用户  
  所属组   所属组

1.3 数据采集

Homebrew 通过 Google Analytics 收集安装、构建错误和操作系统版本统计信息。 
可以使用命令 brew analytics off 选择退出。 
用户可以在 Homebrew 网站上查看过去 30、90 和 365 天的分析数据。
https://formulae.brew.sh/analytics/
https://formulae.brew.sh/analytics/install/365d/
https://formulae.brew.sh/analytics/cask-install/365d/

2. 安装

https://docs.brew.sh/Installation

2.1 Homebrew默认安装目录

  • macOS (Intel) 的 /usr/local
  • macOS (Apple Silicon 即M1) 的 /opt/homebrew
  • Linux 的 /home/linuxbrew/.linuxbrew

2.2 官网安装脚本

https://brew.sh/
将官网提供的脚本,如下,复制到终端执行即可。
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
安装文档和手册页
https://docs.brew.sh/Installation
https://docs.brew.sh/Manpage

2.3 国内安装脚本

使用以上官网脚本安装很可能会非常慢,直到失败... 如下连接可以直接在浏览器里打开安装脚本文件,里面很多提示和注释都是中文的。
https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh
下载并执行安装脚本
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

2.4 使用科大源安装

https://mirrors.ustc.edu.cn/help/brew.git.html
a) 首先在命令行运行如下几条命令设置环境变量:
export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git" 
export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git" 
export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles" 
export HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api"
b1) 之后在命令行运行 Homebrew 安装脚本:
/bin/bash -c "$(curl -fsSL https://github.com/Homebrew/install/raw/HEAD/install.sh)"
b2) 初次安装 Homebrew / Linuxbrew 时,如果无法下载安装脚本(上面b1步骤失败),可以使用科大每日同步的安装脚本文件。
/bin/bash -c "$(curl -fsSL https://mirrors.ustc.edu.cn/misc/brew-install.sh)"

3. 修改源

Mac 下 brew 切换为国内源
https://developer.aliyun.com/article/921959
https://cloud.tencent.com/developer/article/1614039
https://mirrors.ustc.edu.cn/help/brew.git.html
https://mirrors.cloud.tencent.com/
https://mirrors.cloud.tencent.com/homebrew/
https://mirrors.cloud.tencent.com/help/homebrew-bottles.html

3.1 查看当前源

% cd "$(brew --repo)" && git remote -v               
origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git (fetch) 
origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git (push)  
% cd "$(brew --repo homebrew/core)" && git remote -v 
origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git (fetch) 
origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git (push)

3.2 修改为阿里源

$ git -C "$(brew --repo)" remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git 
$ git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
# zsh 替换 brew bintray 镜像 
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc 
$ source ~/.zshrc
# bash 替换 brew bintray 镜像 
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile 
$ source ~/.bash_profile
# 刷新源 
$ brew update

3.3 替换为清华源

# 替换各个源 
$ git -C "$(brew --repo)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git 
$ git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git 
$ git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
# zsh 替换 brew bintray 镜像 
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.zshrc 
$ source ~/.zshrc
# bash 替换 brew bintray 镜像 
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile 
$ source ~/.bash_profile
# 刷新源 
$ brew update

3.4 替换为中科大源

# 替换各个源 
$ git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git 
$ git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git 
$ git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
# zsh 替换 brew bintray 镜像 
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.zshrc 
$ source ~/.zshrc
# bash 替换 brew bintray 镜像 
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile 
$ source ~/.bash_profile
# 刷新源 
$ brew update

3.5 腾讯源

cd "$(brew --repo)" 
git remote set-url origin https://mirrors.cloud.tencent.com/homebrew/brew.git 
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" 
git remote set-url origin https://mirrors.cloud.tencent.com/homebrew/homebrew-core.git 
brew update

3.6 重置为官方源

$ git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git 
$ git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git 
$ git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask
# zsh 注释掉 HOMEBREW_BOTTLE_DOMAIN 配置 
$ vi ~/.zshrc 
# export HOMEBREW_BOTTLE_DOMAIN=xxxxxxxxx
# bash 注释掉 HOMEBREW_BOTTLE_DOMAIN 配置 
$ vi ~/.bash_profile 
# export HOMEBREW_BOTTLE_DOMAIN=xxxxxxxxx
# 刷新源 
$ brew update
查看当前源
% cd "$(brew --repo)" && git remote -v 
origin https://github.com/Homebrew/brew.git (fetch) 
origin https://github.com/Homebrew/brew.git (push) 
% cd "$(brew --repo homebrew/core)" && git remote -v 
origin https://github.com/Homebrew/homebrew-core.git (fetch) 
origin https://github.com/Homebrew/homebrew-core.git (push) 
% cd "$(brew --repo homebrew/cask)" && git remote -v 
origin https://github.com/Homebrew/homebrew-cask (fetch) 
origin https://github.com/Homebrew/homebrew-cask (push)
% cat ~/.zshrc  
# export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles 
# export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles 
# export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles 
# export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.cloud.tencent.com/homebrew-bottles 
# export HOMEBREW_BOTTLE_DOMAIN=''

4. 使用homebrew

获取帮助 % brew help
搜索软件包 brew search TEXT|/REGEX/
查看软件包信息 brew info [FORMULA|CASK...]
安装软件包 brew install FORMULA|CASK...
更新 Homebrew brew update
查看那些已安装的程序需要更新 brew outdated
不带参数,升级所有软件包 brew upgrade [FORMULA|CASK...]
升级指定软件包 brew upgrade [package]
卸载软件包 brew uninstall FORMULA|CASK...
列出已安装的软件包列表 brew list [FORMULA|CASK...]
列出软件包的依赖关系 brew deps [package]
清除过时软件包 brew cleanup
-n 查看可清理的旧版本包,不执行实际操作 brew cleanup -n
清理指定包的旧版本 brew cleanup [package]
配置信息 brew config
检查系统是否存在问题 brew doctor
安装显示debug信息 brew install --verbose --debug FORMULA|CASK
不带参数的话,
将会列出当前已经tapped 的仓库:
% brew tap
homebrew/cask
homebrew/core
homebrew/services

5. 软件列表

核心仓库软件列表,和图形界面软件列表
https://formulae.brew.sh/formula/
https://formulae.brew.sh/cask/
下面是按照统计下载最多的软件排列
https://formulae.brew.sh/analytics/install/365d/
https://formulae.brew.sh/analytics/cask-install/365d/
顺便列举一些常用软件
libreoffice, blender, vlc, virtualbox, microsoft-office, qbittorrent, telegram-desktop, vmware-fusion, kindle, qq, 
google-earth-pro, v2rayx, notion, crossover, gimp, github, telegram, gdisk, youtube-downloader, ccleaner, ffmpeg...

MacOS-Homebrew相关推荐

  1. MacOS Homebrew使用文档

    MacOS Homebrew使用文档 提示:仅记录使用过的功能 未完待续 文章目录 MacOS Homebrew使用文档 下载 一.基本命令 二.Homebrew安装Nginx 三.Homebrew安 ...

  2. 解决 macOS HomeBrew 下载缓慢的问题

    macOS 自身不提供包管理器,常用的包管理器有 HomeBrew MacPorts MacPorts 第一次使用要 build 整个基本库,编译时间很长.优点是不怎么依赖系统,更新 macOS 不会 ...

  3. macOS Homebrew 安装 OpenCV 及切换版本【转】

    转自:https://zhuanlan.zhihu.com/p/121721651 一.安装Homebrew 安装具体过程略. Homebrew国内镜像加速: # 替换 Homebrew git -C ...

  4. MacOS HomeBrew

    命令行-关于安装 /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/mast ...

  5. path manipulation怎么解决_干货!终于!解决macOS下pyenv安装python3.8.2缺少tkinter模块的问题!...

    前言: 笔者不过是一个刚立下flag要学习Python的小白, (这也是笔者的第一篇网文.知乎文,如果没用,求轻虐), 为此还冲动傻傻地配了一台2019款13寸的MacBook Pro. 电脑配置(作 ...

  6. django安装mysql驱动

    django目前支持三种mysql驱动来进行mysql的链接 MySQLdb is a native driver that has been developed and supported for ...

  7. git-flow 流程 备忘清单

    关于 git-flow 是一个 git 扩展集,按 Vincent Driessen 的分支模型提供高层次的库操作. 查看详情 ★ ★ ★ 这个备忘清单展示了 git-flow 的基本操作和效果. ★ ...

  8. django安装mysql驱动_django安装mysql驱动

    django目前支持三种mysql驱动来进行mysql的链接MySQLdb is a native driver that has been developed and supported for o ...

  9. ffmpeg builds by zeranoe_FFmpeg

    FFmpeg 是一个用于处理音视频的开源程序,但它的入门较为复杂,难度较大,且没有较为清晰明了的简易教程,因此有必要,系统性地讲解 FFmpeg 的一些实用操作. 关于下载: 官方下载链接: http ...

  10. linux卸载minicoda2,MiniConda2下载 MiniConda python 2.7 v4.3.30.2 Linux 64位 官方免费版(附安装步骤) 下载-脚本之家...

    MiniConda python 2.7 Linux版是一款可以在Linux系统下使用的Python 环境管理工具,同时MiniConda是一个开源的软件包管理系统和环境管理系统,用于安装多个版本的软 ...

最新文章

  1. 5G频谱相争“兵戎相见”各相部署风起云涌
  2. mysql必知必会学习笔记(一)
  3. 2000年考研英语阅读理解文章三
  4. C++ primer 第8章 IO库
  5. 谷歌将推出新版Pixel 4a 5G:搭载骁龙765G处理器 售价下降至3200元
  6. 网络协议从入门到底层原理(9)HTTP/1.1的升级改进(HTTP/2、HTTP/3)
  7. UEFI+GPT安装Win10和RHEL6.5双系统
  8. MQL5 编程基础:时间
  9. Python爬虫BeautifulSoup4小记
  10. java怪兽仙境攻略_《怪兽仙境》v1.20基础攻略
  11. 文件排版1(C语言)
  12. python 将单词分割成字母_拆分两个字母创建单词python 3
  13. c++动态规划解决一系列数中互不相邻数字之和的最大值
  14. 解析mp3文件,获得mp3中的专辑图片
  15. 家里很舒服,但是你为什么要背井离乡?
  16. centos 安装安全狗
  17. 优先级反转的经典案例——火星拓荒者
  18. 移动光猫调整桥接模式
  19. 详解CorelDRAW双色图样填充
  20. 典型CCN网络——efficientNet(2019-Google-已开源)

热门文章

  1. 类ApplicationInfo详解
  2. 【Neural Style Transfer】 Fast Neural Style
  3. 初等函数导数与泰勒展开
  4. 我们认为2是第一个素数,3是第二个素数,5是第三个素数,依次类推。
  5. Oracle SQL:update更新语句总结
  6. gui设计模式_GUI的完整形式是什么?
  7. jquery ajax封装通用方法
  8. python的分支语句if基本用法
  9. tm1650中文资料_TM1650+msp430单片机 调试及遇到问题的总结
  10. rtx2060为什么叫智商卡_八款RTX2060简单点评,谁是丐中丐,谁又是丐帮帮主