sudo: apt-get: command not found

apt-get是debian(Ubuntu)才有的包管理器,而在Apple 的OS X系统中是没有的。

brew(全称Homebrew)是Mac OSX上的软件包管理工具,能在Mac中方便的安装软件或者卸载软件。brew的这个网站(http://brew.sh)上有对其的一个简单的介绍。

Homebrew安装命令如下:

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

详细安装过程在很多博文中都又详细的介绍。例如这篇博文: 
1、http://jingyan.baidu.com/article/fec7a1e5ec30341190b4e7e5.html 
2、http://blog.csdn.net/azhou_hui/article/details/49718511 (还有详细的brew的命令介绍)

在使用如上的命令安装Homebrew时遇到了如下的错误提示: 
fatal: unable to access 'https://github.com/Homebrew/brew/': SSLRead() return error -36

由于自己没有梯子翻墙,因此查了下有没有其他的方法。然后再https://segmentfault.com/q/1010000000465902看到了如下的解决方法。

vim /etc/resolv.conf,增加nameserver 8.8.8.8或者nameserver 114.114.114.114即可

最好在命令前面加上 sudo,给予权限,否则就会遇到如下一个错误:”/private/etc/resolv.conf” E166: Can’t open linked file for writing

发现一直下载失败的错了我一个,还有很多人遇到也,在这篇博文中,这位博主也进行了相应的记录和处理方法: 
https://my.oschina.net/shede333/blog/364468

原文地址:https://www.cnblogs.com/cina33blogs/p/7527516.html