mac上安装类似 apt-get 的软件包管理器 -- Homebrew

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/yin1031468524/article/details/49979681

linux上安装软件一般都是用apt-get软件包管理器,直接install就行,在mac上需要用到Homebrew这个软件

Homebrew安装

在mac上安装Homebrew很简单,直接在终端上输入一行 Ruby 脚本(Mac 下已经预装了 Ruby)就行

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

如果提示地址不对,可以去下面这个网址看看路径

http://brew.sh/index_zh-cn.html



执行完成后按照提示操作就行了,安装完成后会提示安装成功


Homebrew安装成功后,就可以使用brew命令安装软件了,具体用法可以使用brew help查看

接着安装下常用的git

brew install git


如果不是root用户前面需要加上sudo,如果已经是root权限运行

sudo brew install git

可能会提示下面的错误

Error: Cowardly refusing to `sudo brew install`

You can use brew with sudo, but only if the brew executable is owned by root.

However, this is both not recommended and completely unsupported so do so at

your own risk.

安装完成后输入git version查看当前git安装的版本


猜你喜欢

转载自blog.csdn.net/yin1031468524/article/details/49979681