![](/style/images/good.png)
0
![](/style/images/bad.png)
自动化脚本实现go安装与升级
source link: https://cloudsjhan.github.io/2019/01/12/%E8%87%AA%E5%8A%A8%E5%8C%96%E8%84%9A%E6%9C%AC%E5%AE%9E%E7%8E%B0go%E5%AE%89%E8%A3%85%E4%B8%8E%E5%8D%87%E7%BA%A7/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
自动化脚本实现go安装与升级
源码安装:
- 下载对应的操作系统的最新的 Golang 版本:https://golang.org/dl/
在 home 目录下建立 installGo目录,然后在该目录下新建升级与部署文件以及下载最新的 golang 源码包:
以下是 installOrUpdate.sh 具体内容:
# !/bin/bash |
然后运行:
sudo sh install.sh go1.10.linux-amd64.tar.gz
或者手动设置好GOPATH,GOROOT
编辑 /etc/profile 在文件尾部加入:
export GOPATH=/go |
至此,Go 已安装成功
-
如果需要升级的话只需要将最新的源码包下载到第一步的 installGo 文件夹下,然后运行sudo sh install.sh go1.xx.linux-amd64.tar.gz 即可。
- shell脚本更新地址github
-------------The End-------------
坚持原创技术分享,您的支持将鼓励我继续创作!
(>给这篇博客打个分吧<)
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK