DEV Community

Cover image for Install Go (Golang) on a Linux
johanputra
johanputra

Posted on

Install Go (Golang) on a Linux

To install Go (Golang) on a Linux system, you can follow these steps:

  • Download Go: Open a terminal window and use the wget command to download the Go installation package. You can find the latest version of Go on the official Golang download page.

For example, to download Go version 1.17, you can use:

   wget https://golang.org/dl/go1.17.linux-amd64.tar.gz
Enter fullscreen mode Exit fullscreen mode
  • Extract the Archive: After downloading, you need to extract the downloaded archive. Use the tar command to extract it:
   tar -xvf go1.17.linux-amd64.tar.gz
Enter fullscreen mode Exit fullscreen mode
  • Move Go: Move the extracted Go directory to a location on your system. Traditionally, it's placed in the /usr/local directory. You'll need superuser (root) privileges for this:
   sudo mv go /usr/local
Enter fullscreen mode Exit fullscreen mode
  • Set Environment Variables: You need to set some environment variables to let your system know where Go is installed and where your Go workspace (where you'll develop your Go programs) is located. Add the following lines to your shell profile configuration file (e.g., ~/.bashrc, ~/.zshrc, or ~/.profile):
   export GOPATH=$HOME/go
   export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
Enter fullscreen mode Exit fullscreen mode

Then, apply the changes to your current shell session:

   source ~/.zshrc ~/.bashrc  # or the appropriate configuration file
Enter fullscreen mode Exit fullscreen mode
  • Verify Installation: You can now verify that Go is installed correctly by opening a new terminal window and typing:
   go version

go1.17 linux/amd64
Enter fullscreen mode Exit fullscreen mode

You should see the installed Go version printed in the output.

go version

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read full post →

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more