为CentOS&Ubuntu升级最新版本Golang
CentOS 7
$ rpm --import https://mirror.go-repo.io/centos/RPM-GPG-KEY-GO-REPO
$ curl -s https://mirror.go-repo.io/centos/go-repo.repo | tee /etc/yum.repos.d/go-repo.repo
$ yum install golang
CentOS 6
如果是CentOS6,访问mirror.go-repo.io
会由于CA证书不信任而拒绝,故需要先更新系统的CA证书,然后使用epel的仓库,可以直接下载最新的golang
$ yum install ca-certificates
$ yum install epel-release
# 修改/etc/yum.repos.d/epel.repo,去掉baseurl=的注释,将mirrorlist注释
$ yum clean all && yum update
$ yum install go
Ubuntu 18.04
$ sudo add-apt-repository ppa:longsleep/golang-backports
$ sudo apt-get update
$ sudo apt-get install golang-go
如果 ppa.launchpad.net
比较卡的化,
可以修改域名为:https://launchpad.proxy.ustclug.org
文件位置/etc/apt/sources.list.d/longsleep-ubuntu-golang-backports-bionic.list