Loading... 官方地址: [https://go.dev/](https://go.dev/) 镜像地址: [https://golang.google.cn/dl/](https://golang.google.cn/dl/) ## 1,下载Golang 下载tar包并解压到 /usr/local目录 ```bash wget https://go.dev/dl/go1.23.1.linux-amd64.tar.gz tar xf go1.23.1.linux-amd64.tar.gz -C /usr/local/ ``` ## 2,配置环境变量 在`/etc/profile` 或者`.bashrc`中配置Go的环境变量 ```bash export GO111MODULE=on export GOROOT=/usr/local/go export GOPATH=/home/gopath export PATH=$PATH:$GOROOT/bin:$GOPATH/bin ``` 最后使用 `source` 命令更新一下环境变量就可以了 Last modification:April 25, 2025 © Allow specification reprint Support Appreciate the author Like 如果觉得我的文章对你有用,请随意赞赏