Tag Archives: APT

[Solved] Ubantu18.04 Use APT to install Go environment instruction Error

Under ubantu, the sudo apt install golang go instruction is used to install the go environment. No error is reported during the installation process. The instruction cannot be recognized during use. The error reports are as follows:

root@sh001:~# go env -w GOPROXY=https://goproxy.io,directflag provided but not defined: -w
usage: env [-json] [var ...]
Run 'go help env' for details.
root@sh001:~# go env GO111MODULE = on

Reason: the go environment is not completely installed, and the version installed with apt may be old

Solution:

apt-get install software-properties-common

sudo add-apt-repository ppa:longsleep/golang-backports 
sudo apt-get update 
sudo apt-get install golang-go

test

 go version