RockyLinux9.2编译安装golang1.21🔰
RockyLinux9.2编译安装golang1.21🔰
golang官网
1. 下载go安装包
[root@localhost ~]# wget https://golang.google.cn/dl/go1.21.5.linux-amd64.tar.gz
2. 解压至指定目录
[root@localhost ~]# tar -xvf go1.21.5.linux-amd64.tar.gz -C /usr/local/
3. 配置环境变量
[root@localhost go]# vim /etc/profile
export GOROOT=/usr/local/go export PATH=$PATH:/usr/local/go/bin [root@localhost go]# source /etc/profile
4. 查看版本
[root@localhost ~]# go version go version go1.21.5 linux/amd64