[操作系统]--mac os 安装brew工具步骤

版权声明:尊重原创,转载请标明"本文转自:https://blog.csdn.net/high2011" https://blog.csdn.net/high2011/article/details/81979190

brew安装

brew是mac下的一个超级安装工具,其功能和Linux下的yum、apt-get类似。

1、下载安装

cd  /usr/local

创建安装目录:

sudo mkdir  homebrew

下载二进制文件

curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C     /usr/local

mv Homebrew-legacy-homebrew-5a9e19f/*     homebrew/

添加权限

sudo chmod 755  homebrew/

sudo chown  -R  yangjifei   /usr/local/homebrew

进入安装目录

cd   homebrew/bin

查看版本,并更新brew库:

 ./brew -v

 ./brew  update

2、设置环境变量

在.base_profile文件中增加:

export PATH=$PATH:/usr/local/homebrew/bin

3、使用方法

如:lzsz下载

 brew install wget

如果想卸载lzsz执行

 brew uninstall wget

-----------------------------------排错-------------------------------

localhost:bin yangjifei$ sudo brew install lrzsz

Error: Running Homebrew as root is extremely dangerous and no longer supported.

As Homebrew does not drop privileges on installation you would be giving all

build scripts full access to your system.

localhost:bin yangjifei$

解决:

使用 sudo chown -R yangjifei homebrew

再执行以上步骤

猜你喜欢

转载自blog.csdn.net/high2011/article/details/81979190