armhf debian 安装go1.8.5

1

“`
root@bananapi ~/download # ls
go1.8.5.linux-armv6l.tar.gz
root@bananapi ~/download # go env
GOARCH=”arm”
GOBIN=””
GOCHAR=”5”
GOEXE=””
GOHOSTARCH=”arm”
GOHOSTOS=”linux”
GOOS=”linux”
GOPATH=””
GORACE=””
GOROOT=”/usr/lib/go”
GOTOOLDIR=”/usr/lib/go/pkg/tool/linux_arm”
CC=”gcc”
GOGCCFLAGS=”-fPIC -marm -pthread -fmessage-length=0”
CXX=”g++”
CGO_ENABLED=”1”
root@bananapi ~/download # apt-get remove golang
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following packages were automatically installed and are no longer required:
golang-doc golang-go golang-go-linux-arm
Use ‘apt-get autoremove’ to remove them.
The following packages will be REMOVED:
golang
0 upgraded, 0 newly installed, 1 to remove and 80 not upgraded.
After this operation, 91.1 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database … 23604 files and directories currently installed.)
Removing golang (2:1.3.3-1) …
apt-get remove golang 4.21s user 0.87s system 45% cpu 11.212 total

“`l

2 下载go1.8.5


wget https://storage.googleapis.com/golang/go1.8.5.linux-armv6l.tar.gz 

root@bananapi ~/download # ls  
go1.8.5.linux-armv6l.tar.gz
root@bananapi ~/download # 

3 删除掉原有的go1.2 1.3,新建立一个脚本设置go环境

在/usr/local/bin/下面建立mgo

#!/bin/sh
#SET ENV FOR GO1.8.5 IN /USR/LOCAL
export GOROOT=/usr/local/go1.8.5
export GOPATH=/root/Project/gowork
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH

go version 
echo $GOROOT

猜你喜欢

转载自blog.csdn.net/commshare/article/details/79056702