参考:https://github.com/moovweb/gvm
https://cloud.tencent.com/developer/article/1631909
安装 gvm
sudo yum install curl
sudo yum install git
sudo yum install make
sudo yum install bison
sudo yum install gcc
sudo yum install glibc-devel mercurial
sudo yum install mercurial // mercurial 必须安装
注意:
1. 使用centos9 下载 https://www.mercurial-scm.org/release/mercurial-6.1.3.tar.gz 源码
make install 时报找不到python.h 头文件错误 安装 python3-devel
2. abort: couldn't generate documentation: docutils module is missing
please install python-docutils or see http://docutils.sourceforge.net/
资料查找地址
https://centos.pkgs.org/9-stream/centos-crb-aarch64/python3-docutils-0.16-6.el9.noarch.rpm.html
https://pkgs.org/download/python3-docutils
安装方法
dnf --enablerepo=crb install python3-docutils
安装gvm
$ bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
会提示 /home/.gvm/scripts/gvm 路径
[[ -s "/home/.gvm/scripts/gvm" ]] && source "/home/.gvm/scripts/gvm"
安装 go 1.5+ 版本必须安装 go 1.4
gvm install go1.4 -B
gvm use go1.4
export GOROOT_BOOTSTRAP=$GOROOT
安装
gvm install go1.5+
使用 go 版本
go use go1.5+ [ --default ]
设置加速
centos
go env -w GOPROXY=https://goproxy.cn,direct
win
C:\> $env:GOPROXY = "https://goproxy.cn"
pkgsets 项目之间包的管理和隔离
卸载go
gvm uninstall goxxxx
卸载所有的go
gvm implode