CentOS7安裝go語言環境
阿新 • • 發佈:2019-02-14
1、安裝go語言環境
[root@172 ~]# yum install golang -y
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: ftp.sjtu.edu.cn
* extras: centos.ustc.edu.cn
* updates: centos.ustc.edu.cn
Resolving Dependencies
.......
Installed:
golang.x86_64 0:1.8.3-1.el7
Dependency Installed:
golang-bin.x 86_64 0:1.8.3-1.el7 golang-src.noarch 0:1.8.3-1.el7
Complete!
2、檢查安裝情況
[root@172 ~]# go version
go version go1.8.3 linux/amd64
3、設定環境變數
在/etc/profile中新增GOROOT和GOPATH,如下:
export GOROOT=/usr/lib/golang
export GOPATH=/home
# 生效配置
source /etc/profile