[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