使用yum安装Go(Golang)

9-30 2,466 views

使用yum安装Go(Golang)
本来准备直接yum install golang或者yum install go, 执行命名后,发现没有这个包。于是只能先添加源,然后在使用命令行安装了。

Install on CentOS:

Current version: 1.11
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

Install on Fedora:

Current version: 1.11
rpm --import https://mirror.go-repo.io/fedora/RPM-GPG-KEY-GO-REPO
curl -s https://mirror.go-repo.io/fedora/go-repo.repo | tee /etc/yum.repos.d/go-repo.repo
yum install golang

Example $GOPATH setup:

mkdir -p ~/go/{bin,pkg,src}
echo 'export GOPATH="$HOME/go"' >> ~/.bashrc
echo 'export PATH="$PATH:${GOPATH//://bin:}/bin"' >> ~/.bashrc

Unstable (Pre-release) Packages
Current version: 1.11rc2

CentOS:

rpm --import https://mirror.go-repo.io/centos-unstable/RPM-GPG-KEY-GO-REPO
curl -s https://mirror.go-repo.io/centos-unstable/go-repo-unstable.repo | tee /etc/yum.repos.d/go-repo-unstable.repo
yum install golang

Fedora:

rpm --import https://mirror.go-repo.io/fedora-unstable/RPM-GPG-KEY-GO-REPO
curl -s https://mirror.go-repo.io/fedora-unstable/go-repo-unstable.repo | tee /etc/yum.repos.d/go-repo-unstable.repo
yum install golang

来源:https://go-repo.io/
https://cloud.tencent.com/developer/article/1478660

golang 连接 mysql 数据库

参考 https://tutorialedge.net/golang/golang-mysql-tutorial/ 使用文档 : https://sqlchoice.azurewebsites.net/en-us/sql-server/developer-get-started...

阅读全文

centos yum 安装golang

Centos # Current version: 1.12.5 $ rpm --import https://mirror.go-repo.io/centos/RPM-GPG-KEY-GO-REPO $ curl -s https://mirror.go-repo.io/centos/go-...

阅读全文

mac,vs code调试go文件的时候出现”Could not launch process: stub exited while waiting for connection”

1. sudo vi /etc/hosts 2.按顺序输入以下内容 255.255.255.255 broadcasthost 127.0.0.1 localhost ::1 localhost

阅读全文

欢迎留言