3.输入:wq!
强行储存退出就好了。
参考:https://blog.csdn.net/j755ing/article/details/105955118
【最终推荐】使用国内镜像安装Brew:
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
Linux系统有个让人蛋疼的通病,软件包依赖,好在当前主流的两大发行版本都自带了解决方案,Red hat有 yum,Ubuntu有 apt-get。
Mac os 中没有类似的东东,不过有第三方库支持:Homebrew。Homebrew简称brew,是Mac OSX上的软件包管理工具,能在Mac中方便的安装软件或者卸载软件,可以说Homebrew就是mac下的apt-get、yum神器。
Homebrew安装
1、首先要安装 xcode,在 AppStore 中通过搜索关键字 xcode 找到软件并安装,当前的版本 7.3.1 大概有 3.8G左右。
2、在 终端 中执行如下命令行
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"Homebrew官网改为了:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
执行这个命令有时会返回400错误,估计被墙了,不过,过几分钟重试下又ok了。
Homebrew使用
搜索软件:brew search 软件名,如 brew search wget
安装软件:brew install 软件名,如 brew install wget
卸载软件:brew remove 软件名,如 brew remove wget
更多的?自己去官网挖吧 http://brew.sh/index_zh-cn.html
Homebrew 会将套件安装到独立目录(总目录为 /usr/local/Cellar),所以你无需担心软件的安装位置,并将文件软链接至 /usr/local/bin,如:
$ pwd /usr/local/Cellar $ ll total 0 drwxr-xr-x 8 jianbao admin 272 5 26 00:12 ./ drwxrwxr-x 23 jianbao admin 782 5 25 00:30 ../ drwxr-xr-x 3 jianbao admin 102 5 25 16:59 mcrypt/ drwxr-xr-x 3 jianbao admin 102 5 25 16:59 mhash/ drwxr-xr-x 3 jianbao admin 102 5 24 00:38 openssl/ drwxr-xr-x 3 jianbao admin 102 5 26 00:09 readline/ drwxr-xr-x 3 jianbao admin 102 5 26 00:09 sqlite/ drwxr-xr-x 3 jianbao admin 102 5 26 00:12 subversion/
Warning: autoconf-2.69 already installed, it's just not linked
按理说,brew install 软件后,会自动在 /usr/local/bin 建立软链接。好吧,手动建立一个就是了:
ln -s /usr/local/Cellar/autoconf/2.69/bin/autoconf /usr/local/bin/autoconf ln -s /usr/local/Cellar/autoconf/2.69/bin/autoheader /usr/local/bin/autoheader
Failed to connect to raw.githubusercontent.com port 443: Operation timed out
解决方案:
更改hosts文件。
1.Mac终端中输入: sudo vim /etc/hosts
2.然后加上下面的这些IP地址配置
52.74.223.119 github.com 192.30.253.119 gist.github.com 54.169.195.247 api.github.com 185.199.111.153 assets-cdn.github.com 151.101.76.133 raw.githubusercontent.com 151.101.108.133 user-images.githubusercontent.com 151.101.76.133 gist.githubusercontent.com 151.101.76.133 cloud.githubusercontent.com 151.101.76.133 camo.githubusercontent.com 151.101.76.133 avatars0.githubusercontent.com 151.101.76.133 avatars1.githubusercontent.com 151.101.76.133 avatars2.githubusercontent.com 151.101.76.133 avatars3.githubusercontent.com 151.101.76.133 avatars4.githubusercontent.com 151.101.76.133 avatars5.githubusercontent.com 151.101.76.133 avatars6.githubusercontent.com 151.101.76.133 avatars7.githubusercontent.com 151.101.76.133 avatars8.githubusercontent.com
3.输入:wq!
强行储存退出就好了。
参考:https://blog.csdn.net/j755ing/article/details/105955118
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"