首页 > 学习笔记 > Mac端的神器,homebrew常用命令
2025
02-07

Mac端的神器,homebrew常用命令

查看brew镜像源

git -C “$(brew –repo)” remote -v

查看homebrew-core镜像源

git -C “$(brew –repo homebrew/core)” remote -v

查看homebrew-cask镜像源(需要安装后才能查看)

git -C “$(brew –repo homebrew/cask)” remote -v

替换brew.git:

cd “$(brew –repo)”
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git

替换homebrew-core.git:

cd “$(brew –repo)/Library/Taps/homebrew/homebrew-core”
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git

替换homebrew-cask.git:

cd “$(brew –repo)/Library/Taps/homebrew/homebrew-cask”
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git

应用生效

brew update

替换homebrew-bottles:

echo ‘export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles’ >> ~/.bash_profile
source ~/.bash_profile

版本号:brew -v
更新:brew update
本地软件库列表:brew list
查看软件库版本:brew list –versions
查找软件包:brew search xxx (xxx为要查找软件的关键词)
安装软件:brew cask install xxx(xxx为软件名称)
卸载软件:brew cask uninstall xxx
查找软件安装位置:which xxx (xxx为软件名称)
清理所有旧版本包:brew cleanup
列出所有旧版本包:brew cleanup -n
查看一安装软件的依赖:brew deps -installed –tree

最后编辑:
作者:admin
这个作者貌似有点懒,什么都没有留下。