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
Similar Posts:
- ubuntu “sudo: add-apt-repository: command not fou”
- How to Solve VS Code Install Go Plug-in Error
- Python installs pandas library Error: Could not import the LZMA module appears when
- [Solved] docker-compose:No module named ssl_match_hostname; ImportError: No module named shutil_get_te…
- [Solved] NVIDIA SMI instruction error: failed to initialize nvml: Driver
- Solution to fatal error in launcher: unable to create process using ‘”‘In PIP installation
- Go Compile Error: package embed is not in GOROOT (/usr/local/go/src/embed)
- [Solved] Python import pandastime Error: Could not import the lzma module
- [How to Solve] protoc: Command not found
- Linux Error: apt-get 404 not found [How to Solve]