Mac安装HomeBrew,Htop

安装HomeBrew

第一步是访问HomeBrew网站,并复制红色框
在这里插入图片描述
第二步是将复制的代码粘贴到终端执行
如果执行的时候报如下错误:
curl: (6) Could not resolve host: raw.githubusercontent.com,表示raw.githubusercontent.com的ip不对。
解决方案:
1.sudo vi /etc/hosts
2.199.232.68.133 raw.githubusercontent.com添加至最后一行
3.保存退出,重新执行

homebrew添加清华源:

重置brew.git

cd "$(brew --repo)"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git

重置核心软件仓库homebrew-core.git

cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git

重置homebrew-bottles

echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.bash_profile

最后source文件

source ~/.bash_profile

安装Htop:

brew install htop

安装htop后,运行时报如下错误:

htop: command not found

然后再安装htop会提示:

Warning: htop 2.2.0_1 is already installed, it's just not linked

然后输入:

brew link htop

会返回如下信息:

Linking /usr/local/Cellar/htop/2.2.0_1...
Error: Could not symlink bin/htop
Target /usr/local/bin/htop
already exists. You may want to remove it:
  rm '/usr/local/bin/htop'

To force the link and overwrite all conflicting files:
  brew link --overwrite htop

To list all files that would be deleted:
  brew link --overwrite --dry-run htop

就按照这个提示依次输入命令:

rm '/usr/local/bin/htop'
brew link --overwrite htop
brew link --overwrite --dry-run htop

如过中间有提示不能写入之类的错误,使用如下命令

sudo chown -R `whoami`:admin /usr/local/..(根据自己的路径)
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值