homebrew官网,mac軟體包的管理器,国内源安装
什么是homebrew?
简而言之,就是一个应用市場,就好比 win 上的軟體管家(不是安全管家哈,这个只有安装、删除等管理軟體包的功能)官方定義的是:macOS 缺失的軟體包的管理器
homebrew官网: https://brew.sh/
Homebrew国内源
- 清華源
- https://mirrors.tuna.tsinghua.edu.cn/help/homebrew
- 中科大源
- http://mirrors.ustc.edu.cn/help/brew.git.html
Homebrew 是一款自由及開放源代碼的軟體包管理系統,用以简化 macOS 和 linux 系統上的軟體安装过程。它擁有安装、卸载、更新、查看、搜索等很多實用的功能,透過简單的一条指令,就可以實现包管理,十分方便快捷。
Homebrew
主要有四个部分组成: brew
、homebrew-core
、homebrew-bottles
、homebrew-cask
。
名称 | 說明 |
---|---|
brew | Homebrew 源代碼仓库 |
homebrew-core | Homebrew 核心軟體仓库 |
homebrew-bottles | Homebrew 预编译二进制軟體包 |
homebrew-cask | 提供 macOS 应用和大型二进制文件 |
HomeBrew安装
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
建議使用:中科院
卸载
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/HomebrewUninstall.sh)"
HomeBrew换源
中科大(建議使用)
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
brew update
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/bottles' >> ~/.bash_profile
source ~/.bash_profile
阿里云
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
brew update
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
清華
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
brew update
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles/bottles' >> ~/.bash_profile
source ~/.bash_profile
騰讯
git -C "$(brew --repo)" remote set-url origin https://mirrors.cloud.tencent.com/homebrew/brew.git
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.cloud.tencent.com/homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.cloud.tencent.com/homebrew/homebrew-cask.git
brew update
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.cloud.tencent.com/homebrew-bottles/bottles' >> ~/.bash_profile
source ~/.bash_profile
初始默认镜像(国外源)
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.git
brew update
HomeBrew常用命令
軟體搜索
brew search TEXT|/REGEX/
查看軟體相關信息(顯示軟體的各种信息(包括版本、源碼地址、依賴等等)
brew info [FORMULA|CASK...]
安装軟體
brew install FORMULA|CASK...
卸载軟體
brew uninstall FORMULA|CASK...
查看安装列表
brew list
查看包信息
brew info [FORMULA|CASK...]
查看哪些包可以更新
brew outdated
更新包 Homebrew 会安装新版本的包,但旧版本依然会保留
brew upgrade
brew 自身更新
brew update
清理旧版本和快取
brew cleanup # 清理所有包的旧版本
brew cleanup [FORMULA ...] # 清理指定包的旧版本
brew cleanup -n # 查看可清理的旧版本包,不执行實際操作
鎖定不想更新的包
brew pin [FORMULA ...] # 鎖定某个包
brew unpin [FORMULA ...] # 取消鎖定
tips:因為update会一次更新所有的包的,当我们想忽略的时候可以使用这个命令
軟體服務管理
brew services list # 查看使用brew安装的服務列表
brew services run formula|--all # 启动服務(仅启动不注册)
brew services start formula|--all # 启动服務,并注册
brew services stop formula|--all # 停止服務,并取消注册
brew services restart formula|--all # 重启服務,并注册
数据评估
关于Homebrew特别声明
本站ai工具百寶箱提供的Homebrew都来源于网络,不保证外部链接的准确性和完整性,同时,对于该外部链接的指向,不由ai工具百寶箱实际控制,在2024年11月23日 上午2:05收录时,该网页上的内容,都属于合规合法,后期网页的内容如出现违规,可以直接联系网站管理员进行删除,ai工具百寶箱不承担任何责任。
相关导航
暂无评论...