阿里云CentOS服务器下安装Golang1.13并配置代理

注:root账户或添加sudo命令运行。

  • 下载到/usr/local位置并解压
    • cd /usr/local
    • wget https://studygolang.com/dl/golang/go1.13.linux-amd64.tar.gz
    • tar -xzvf go1.13.linux-amd64.tar.gz

  • $HOME位置创建go工作目录
    • cd
    • mkdir go

  • 配置环境变量并设置代理
    • vim /etc/profile
      • export GOROOT=/usr/local/go
      • export PATH=$PATH:$GOROOT/bin
      • export GOPATH=$HOME/go
      • export GO111MODULE=auto
      • export GOPROXY=https://goproxy.cn,direct
    • source /etc/profile

  • 安装git
    • yum update
    • yum install -y git

posted on 2019-09-24 13:20  GaiheiluKamei  阅读(1852)  评论(0编辑  收藏  举报

导航