linux 安装Brew

点击查看原文

Linuxbrew:Linux下的Homebrew

前不久还在跟同事抱怨ubuntu的apt-get问题多,最近就发现了一个好用的工具Linuxbrew。apt-get安装的东西都堆在系统里,如果不在官方源里还要加个ppa,然后等漫长的update完才能装,想删除啥东西还各种删不干净,关键你一不小心他还出问题给你看,你就不能安装新软件了。Mac上的homebrew就清爽多了,装在Cellar目录下,源就是github上的仓库的一个个ruby脚本,brew list一下就知道装了哪些,删也能删的干净。Linuxbrew把软件就安装在用户目录下,重装系统也不用每次重新来一次了。

安装

Linuxbrew的首页是http://linuxbrew.sh,安装有个ruby脚本。

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install)"

我用这个没有跑成功... 不就是ruby脚本吗,我干脆自己clone一份。

git clone https://github.com/Linuxbrew/brew.git ~/.linuxbrew

还得把homebrew-core克隆下来,里面有一些核心的软件安装formula,比如gcc。

git clone https://github.com/Linuxbrew/homebrew-core ~/.linuxbrew/Library/Taps/homebrew

配置一下bash_profile文件

export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"

然后source一下就可以用了。

装软件

装一个oracle的jdk  brew install jdk

==> Downloading from http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jdk-8u112-linux-x64.tar.gz?AuthParam=1477706348_b0b597b7531f263567737994182c7cd5
download.oracle.com:80 ... OK
######################################################################## 100.0%
==> Caveats
By installing and using JDK you agree to the
Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX
http://www.oracle.com/technetwork/java/javase/terms/license/index.html ==> Summary
/home/jash/.linuxbrew/Cellar/jdk/1.8.0-112: 1,628 files, 353.7M, built in 9 minutes 55 seconds

我还找到一个仓库里面有很多开发工具,比如smartgit, idea等等软件https://github.com/athrunsun/homebrew-linuxbinary

brew tap athrunsun/linuxbinary

蹭着同事的vpn,把要装的都给装了一个遍,哈哈哈。

brew install smartgit
brew install intellij-idea-ce
brew install *
brew install proxychains-ng
brew install skype
brew install telegram
brew install android-studio
brew install pycharm-ce
brew install sublime-text
brew install telegram
brew install unetbootin
brew install *-go-local
brew install smart-synchronize

可惜没有看到leanote、atom、firefox等软件。

总结

用起来比apt-get爽不少,虽然ubuntu最近开始在做一个snap工具,而且还是go写的,但是可惜软件太少,这玩意还是brew用起来顺手。对了,如果装不上软件,那可能要*,我用的是*-qt + proxychains4的工具。

上一篇:.NET框架设计—常被忽视的C#设计技巧


下一篇:java log4j基本配置及日志级别配置详解