Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Programming»How To Install Go 1.19 on Debian 11/10/9

    How To Install Go 1.19 on Debian 11/10/9

    By RahulAugust 15, 20222 Mins Read

    What is Go ?

    Go is an open-source programming language developed by a team at Google. It provides easy to build simple, reliable, and efficient software. This language is designed for writing servers, that’s why it is using widely these days. At the update time of this tutorial Go 1.19 is the latest version available.

    Advertisement

    This tutorial will help you to install Go 1.19 on your Debian 11, Debian 10, Debian 9, and Debian 8 Linux systems.

    Step 1 – Install Go on Debian

    You need sudo access or root access to your system for Go installation. Now login to your Debian system using shell or ssh and upgrade to apply the latest security updates there.

    sudo apt-get update 
    sudo apt-get -y upgrade 
    

    Now download the Go language binary archive file using the following link. To find and download latest version available or 32 bit version go to official download page.

    wget https://go.dev/dl/go1.19.linux-amd64.tar.gz 
    

    Now extract the downloaded archive and install it to the desired location on the system. For this tutorial, I am installing it under /usr/local directory. You can also put this under the home directory (for shared hosting) or other location.

    tar -xvf go1.19.linux-amd64.tar.gz 
    sudo mv go /usr/local 
    

    Step 2 – Setup Go Environment

    After completing step 1, Now configure the Go language environment variables for your project. Commonly you need to set 3 environment variables as GOROOT, GOPATH and PATH.

    GOROOT is the location where Go package is installed on your system.

    export GOROOT=/usr/local/go 
    

    GOPATH is the location of your work directory. For example my project directory is ~/Projects/Proj1 .

    export GOPATH=$HOME/Projects/Proj1 
    

    Now set the PATH variable to access go binary system wide.

    export PATH=$GOPATH/bin:$GOROOT/bin:$PATH  
    

    All the above environment will be set for your current session only. To make it permanent add above commands in ~/.profile file.

    Step 3 – Verify Go Installation

    Finally, you have successfully installed and configured go language on your system. First, use the following command to check the installed Go version.

    go version 
    
    GOARCH="amd64" GOBIN="" GOCACHE="/root/.cache/go-build" GOEXE="" GOHOSTARCH="amd64" GOHOSTOS="linux" GOOS="linux" GOPATH="/home/tecadmin/Projects/Proj1" GORACE="" GOROOT="/usr/local/go" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" CC="gcc" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build661994963=/tmp/go-build" CXX="g++" CGO_ENABLED="1"

    debian Go Golang
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Validate Email Addresses in Python (Using Regular Expressions)

    PHP Arrays: A Beginner’s Guide

    How to Create and Read List in Python

    View 5 Comments

    5 Comments

    1. Jyves on December 21, 2020 11:18 am

      I agree with Christian.
      And in the same time i get 2 questions :
      1/ why don’t you install the “official” debian package.
      In my distro the last version is 1.14 why do you want to get the 1.15 one?
      Debian packages get pre and post scripts that do the job for you.

      2/ Such a strange way to do by copying files that way! No?
      Not surprised that you complain of strange behavior afterwards.

      Reply
    2. Kristian on October 9, 2019 1:08 am

      do NOT copy everything to /usr/local like I did “go/* /usr/local ”

      I’ve been trying to clean up this mess for a few hours now.

      Honestly, why is this installation a mess to begin with?
      Some kind of bash installation script would help a lot of noobs out here.

      Reply
    3. Anthony on May 2, 2019 11:37 pm

      Easy peasy — thanks!

      Reply
    4. Ever on June 24, 2018 11:00 am

      Thanks.

      Reply
    5. PL on May 23, 2018 7:30 pm

      You don’t need to sudo the tar extraction command

      Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Implementing a Linux Server Security Audit: Best Practices and Tools
    • cp Command in Linux (Copy Files Like a Pro)
    • 15 Practical Examples of dd Command in Linux
    • dd Command in Linux (Syntax, Options and Use Cases)
    • Iptables: Common Firewall Rules and Commands
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.