以下是在Debian下搭建Golang环境的步骤:
sudo apt update。sudo apt install -y golang。go version。sudo apt remove --autoremove -y golang。wget https://go.dev/dl/go1.24.4.linux-amd64.tar.gz。/usr/local:sudo rm -rf /usr/local/go,然后sudo tar -C /usr/local -xzf go1.24.4.linux-amd64.tar.gz,最后rm go1.24.4.linux-amd64.tar.gz。~/.bashrc或~/.profile,添加export PATH=$PATH:/usr/local/go/bin和export GOPATH=$HOME/soft/mygopath,然后source ~/.bashrc。go version。sudo apt install -y software-properties-common,然后sudo add-apt-repository -y ppa:longsleep/golang-backports。sudo apt update,再sudo apt install -y golang。go version。可安装VS Code等IDE,以及Go扩展等开发工具,还可创建~/go/{src,bin,pkg}工作目录。