Saki's 研究记录

yum 安装/更新 golang

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

安装

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

更新

  1. yum 安装版本比较旧,需要先删掉再手动安装较新的版本:

    1
    2
    3
    yum rm golang
    wget https://golang.org/dl/go1.16.4.linux-amd64.tar.gz
    rm -rf /usr/local/go && tar -C /usr/local -xzf go1.16.4.linux-amd64.tar.gz
  2. 添加环境变量:

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

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

Done.

CATALOG
  1. 1. 安装
  2. 2. 更新