ChainTools
  • Home
    • Installation Guides
      • Install Cosmovisor
      • Install Hermes Relayer
      • Backup Server
      • Install Golang
      • Install Rust
      • Install Node.js
      • Install Yarn
    • Node Configuration
      • Pruning Cosmos SDK
    • Tooling Guides
      • Node Monitoring
        • Panic Cosmos
      • Systemd Service Template
      • Configure journalctl
      • Caddy Web Server/Proxy
  • Chains
    • General
      • Endpoints
      • Peers & Seeds
      • State-Sync
      • Validator bootstrap commands
    • Mainnets
      • BitSong
      • Comdex
      • Decentr
      • Evmos
      • Juno
      • Kujira
        • IBC
      • KiChain
      • Nois
      • Omniflix
      • Rizon
    • Testnets
      • Omniflix
      • Juno
      • Comdex
  • Snippets
    • Python gRPC
    • Handy commands
  • Workspace
    • Drafts
      • Dyson Protocol Node Deployment with Podman
Powered by GitBook
On this page
  • Download and extract repository
  • Add Go environmental variables
  • Important
  1. Home
  2. Installation Guides

Install Golang

PreviousBackup ServerNextInstall Rust

Last updated 1 year ago

Download and extract repository

AMD and Intel compatible processors

GOVER=$(curl https://go.dev/VERSION?m=text | head -n 1)
wget https://golang.org/dl/${GOVER}.linux-amd64.tar.gz && \
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf ${GOVER}.linux-amd64.tar.gz

ARM processors

GOVER=$(curl https://go.dev/VERSION?m=text | head -n 1)
wget https://golang.org/dl/${GOVER}.linux-arm64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf ${GOVER}.linux-arm64.tar.gz

NOTE: That will install latest version of Go

Install previous version

GOVER=go1.20.3
wget https://golang.org/dl/${GOVER}.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf ${GOVER}.linux-amd64.tar.gz

Add Go environmental variables

Set of variables, which should be set for user(s) with need to build Go apps.

That can be placed in ${HOME}/.profile or ${HOME}/.bashrc or any other shell-specific file, whic sets variable during logon

# add environmental variables for Go
if [ -f "/usr/local/go/bin/go" ] ; then
    export GOROOT=/usr/local/go
    export GOPATH=${HOME}/go
    export GOBIN=${GOPATH}/bin
    export PATH=${PATH}:${GOROOT}/bin:${GOBIN}
fi

NOTE: To make sure that Go-specific environment will be added to new users profiles below code needs to be added to /etc/skel/.profile.

Important

Once all changes are applied and files installed make sure all shell instances will be closed and then logoff and logon again to system.

That way all environmental variables will be set correctly.

Video demonstrates steps described below.