- 我之前是Ubuntu用户,后来用了macOS,但是发现macOS的包管理工具不好用,偶尔会有些软件安装不上,网上查呢也不一定查到结果
- 前台我调试golang的代码,想要下载graphviz,但是无论我是升级xcode(还导致git 崩溃),还是网上查资料,就是安装不上,说
Invalid bottle tag symbol
, 本来打算放弃,忽然想起来在Ubuntu中,我安装软件的时候,有时候安装特别慢(因为国内一些原因,访问国外网站很慢),那这个时候怎么办呢?我们往往会切换镜像源,这个时候我突然来了灵感,干脆吧brew的镜像源给替换成国内的,说做就做
$ 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)
$ 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
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
$ source ~/.zshrc
$ echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
$ source ~/.bash_profile
$ brew update
- 切换完毕后再次执行
brew install Graphviz
下载了很多依赖包 - 但是又报错了
![在这里插入图片描述](https://img-blog.csdnimg.cn/b76f6e1c53654c8daed8b8779eaf942e.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA6ICBQeaKgOacr-iBlOebnw==,size_20,color_FFFFFF,t_70,g_se,x_16)
- 某个依赖安装失败了,没关系,我已经知道brew 就是和apt-get yun 一样的包管理工具,先解决这个依赖,执行
brew install pango
先把依赖包安装上,再次执行brew install Graphviz
安装成功
![在这里插入图片描述](https://img-blog.csdnimg.cn/58c9d38d22554b7ab641c2281a7c0ce0.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA6ICBQeaKgOacr-iBlOebnw==,size_20,color_FFFFFF,t_70,g_se,x_16)