Brew—mac中类似apt-get的功能

ubuntu的apt-get实在是方便,需要安装什么,一个命令搞定,相关的依赖包统统由apt-get维护。而Mac中也有一种很牛的替代工具MacPorts

homebrew主页对brew进行了详细的描述(https://github.com/Homebrew/homebrew)

一、安装brew

二、brew安装软件

以wget为例

三、brew卸载软件

四、brew检索软件

五、brew编辑下载软件的内容

案例:sourceforge.net被墙了
报错:
sh-3.2# brew upgrade
==> Upgrading 6 outdated packages, with result:
libpng 1.5.12, imagemagick 6.7.7-6, libtiff 4.0.2, pcre 8.31, lighttpd 1.4.31, wget 1.14
==> Upgrading libpng
==> Downloading http://downloads.sf.net/project/libpng/libpng15/1.5.12/libpng-1.5.12.tar.gz

curl: (56) Recv failure: Connection reset by peer
Error: Download failed: http://downloads.sf.net/project/libpng/libpng15/1.5.12/libpng-1.5.12.tar.gz

解决方案:

# brew edit libpng

很明显我用ftp.simplesystems.org替换了downloads.sf.net的文件地址。

接下来保存好内容,继续brew,成功!

六、berw link

tanqianshan[2.其他公司表型整理]$ brew install pdf2htmlEX
Warning: You are using OS X 10.12.
We do not provide support for this pre-release version.
You may encounter build failures or other breakage.
Error: You must `brew link cmake’ before pdf2htmlex can be installed
解决办法:
brew unistall cmake
sudo brew install cmake

参考资料:
http://snowolf.iteye.com/blog/774312
http://community.itbbs.cn/thread/21327/

《Brew—mac中类似apt-get的功能》有1个想法

  1. Pingback: tmux | Sam's Note

发表评论

电子邮件地址不会被公开。 必填项已用*标注