1.切換到安裝目錄
cd /usr/local
2.下載安裝包
wget https://go.dev/dl/go1.23.6.linux-amd64.tar.gz
3.解壓安裝包
sudo tar -C /usr/local -xzf go1.23.6.linux-amd64.tar.gz
4.配置環境變量
vi /etc/profile
export PATH=$PATH:/usr/local/go/binexport GOPATH=$HOME/goexport PATH=$PATH:$GOPATH/bin
保存并執行 source /etc/profile 使配置生效
5.驗證是否安裝成功
go version