欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

[ubuntu server 16.04下的安装脚本] 13.Ubuntu16.04一键安装Golang

程序员文章站 2022-06-06 16:05:55
...
#!/bin/bash

cd /opt
wget  https://dl.google.com/go/go1.10.linux-amd64.tar.gz


tar -xzvf go1.10.linux-amd64.tar.gz

mkdir -p /usr/local/go
cp -rfv /opt/go/* /usr/local/go/

echo "export GOPATH=/opt/go
export GOROOT=/usr/local/go
export GOARCH=386
export GOOS=linux
export GOBIN=$GOROOT/bin/
export GOTOOLS=$GOROOT/pkg/tool/
export PATH=$PATH:$GOBIN:$GOTOOLS" >> /etc/profile

ln -s /usr/local/go/bin/go /usr/bin/go


go version