Mac 下的包安裝管理工具:homebrew
- homebrew 的安裝詳見傳送門拯啦,由于 homebrew 的鏡像是國外的,每次下載更新速度較慢、需要翻墻册招;所以我們可以配置下將鏡像源文件改為國內的(此處用的清華大學的)
vim ~/.bash_profile
echo "export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles" >> ~/.bash_profile
source ~/.bash_profile # 使剛才的配置立即生效
- Homebrew 常用命令:
brew -v
brew update --verbose #觀察update過程
brew info demo #查看demo包的信息
Brew tap xxx 添加源
brew update #更新自己的Homebrew
brew search demo #尋找包名含有demo的包
brew doctor #檢查brew的運行狀態(tài)
brew outdates #檢查本機內已經處于舊版本的包
brew list #列出brew安裝的包
brew cleanup #清理緩存
brew install demo #安裝demo包
brew uninstall demo #卸載demo包
brew link demo #關聯(lián)demo包
php -m | grep phalcon #檢測擴展
brew -S phalcon #找到對應版本的phalcon擴展
#修改homebrew鏡像源:
#國內清華大學
echo "export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles" >> ~/.bash_profile
#中科大源
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile
#立即生效
source ~/.bash_profile
- 安裝 cakebrew抖单, cakebrew 可理解為 homebrew 的可視化操作工具萎攒;
brew cask install cakebrew
20190304
由于
Homebrew/php
自來水在2018年3月底被棄用,并將所有 PHP 公式轉移到Homebrew/core
矛绘,舊的brew tap homebrew/dupes耍休、brew tap homebrew/versions、brew tap homebrew/homebrew-php
都會報以下錯誤(目前國內百度都找不到解決這個問題的方法):
Error: homebrew/php was deprecated. This tap is now empty as all its formulae were migrated.
附上一些參考文章: