golang1.5以后实现了自编译,也就是用golang开发golang。因此在安装新版本的golang时需要先安装一个golang1.4版本
安装golang1.4
- wget https://storage.googleapis.com/golang/go1.4-bootstrap-20170531.tar.gz
- tar -xf go1.4-bootstrap-20170531.tar.gz
- cd go/src
- ./make.bash
- 成功后信息
- Installed Go for linux/amd64 in /home/test/go
- Installed commands in /home/test/go/bin
- mv go go1.4
安装golang1.9
- wget https://storage.googleapis.com/golang/go1.9.src.tar.gz
- tar -xf go1.9.src.tar.gz
- cd go/src
- ./all.bash
- mv go /usr/local/go1.9
- vim /etc/profile
- source /etc/profile
- export PATH=$PATH:/usr/local/go1.9/bin
- go version
下载安装地址:https://golang.org/doc/install/source?download=go1.9.src.tar.gz
有疑问加站长微信联系(非本文作者)