我要评分
获取效率
正确性
完整性
易理解

Installing Go

  1. Download the Go source package. In this example, the source package is saved to the /home directory.
    1
    2
    cd /home
    wget https://dl.google.com/go/go1.17.7.linux-arm64.tar.gz
    
  2. Decompress the source package to the /usr/local directory.
    1
    tar -zxvf go1.17.7.linux-arm64.tar.gz -C /usr/local
    
  3. Set environment variables.
    1. Open the /etc/profile file.
      1
      vim /etc/profile
      
    2. Press i to enter the insert mode, and add the following content to the end of the file:
      export GOROOT=/usr/local/go
      export PATH=$PATH:$GOROOT/bin
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Make the environment variables take effect.
    1
    source /etc/profile
    
  5. View the installation path.
    1
    ls /usr/local/go
    

  6. View the version.
    1
    go version