ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

mac 安装和升级go

2021-01-09 17:01:09  阅读:701  来源: 互联网

标签:core git 升级 brew mac Homebrew go homebrew


mac 安装和升级go

go1.9.7 升级到 go1.15.6

之前由于电脑上面安装的go版本太低,导致部分程序调试失败,特此升级go版本记录升级过程

因为使用的brew安装的go,这里升级go版本,因此需要先执行

brew update

此时很不幸的是报错了

git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!

在这里插入图片描述

可能是国内环境问题导致,解决办法

cd /usr/local/Homebrew/Library/Taps/
mkdir homebrew
cd homebrew
git clone https://mirrors.ustc.edu.cn/homebrew-core.git

如果文件已经存在,会报错

在这里插入图片描述

此时执行删除文件操作

rm -rf homebrew-core

然后再次执行git clone

git clone https://mirrors.ustc.edu.cn/homebrew-core.git

在这里插入图片描述

由于之前已经安装的go1.9.7

在这里插入图片描述

需要先执行卸载操作

brew uninstall go@1.9

卸载完成后执行安装

brew install go

在这里插入图片描述

升级完毕

第一次安装 执行下面代码即可

brew install go

在这里插入图片描述

标签:core,git,升级,brew,mac,Homebrew,go,homebrew
来源: https://blog.csdn.net/qq_33461914/article/details/112393983

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有