Saki's 研究记录

yum install/update golang

字数统计: 147阅读时长: 1 min
2021/10/11

Install

Install EPEL package by using yum install epel-release command:

1
yum install -y epel-release

Update your system:

1
yum update

Install Golang using yum:

1
yum install -y golang

Check Golang version:

1
2
go version
go version go1.15.14 linux/amd64

Update

Unless someone either adds Go 1.7+ to a repo or builds a specific repo for it, you need to manually install it.
Access https://go.dev/dl/ first PLS, select Glang version which you prefer.

1
2
3
yum rm golang
wget https://go.dev/dl/go1.17.4.linux-amd64.tar.gz
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.17.4.linux-amd64.tar.gz

Add /usr/local/go/bin to PATH Variable:

1
2
echo "export PATH=$PATH:/usr/local/go/bin">>/root/.bashrc
source /root/.bashrc

Check Golang version:

1
2
go version
go version go1.17.4 linux/amd64

Reference

Done.

CATALOG
  1. 1. Install
  2. 2. Update
  3. 3. Reference