Installing Go on Linux

Installing Go

Golang can be downloaded from the site golang.org

wget https://golang.org/dl/go1.16.6.linux-386.tar.gz

wget https://golang.org/dl/go1.16.6.linux-amd64.tar.gz

After downloading, check that the checksum matches the one recorded on the site

sha256sum go1.16.6.linux-386.tar.gz

sha256sum go1.16.6.linux-amd64.tar.gz

4c8179d406136979724c71732009c7e2e7c794dbeaaa2a043c00da34d4be0559 go1.16.6.linux-386.tar.gz

It matches the value on the site - look at the bottom line

Installing the image over the network VirtualBox image from website www.aredel.com

Unpack the archive

sudo tar -C /usr/local -xzf go1.16.6.linux-386.tar.gz

sudo tar -C /usr/local -xzf go1.16.6.linux-amd64.tar.gz

Add the path to go to PATH

cd
vi ~/.bash_profile

vi ~/.bashrc

export PATH="$PATH:/usr/local/go/bin"

Create a working directory

mkdir ~/go

Check whether Go is installed

go version

If you got something like this

go version go1.16.6 linux/386

Then all is well

If you got an error

-bash: /usr/local/go/bin/go: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

Try installing glibc.i686

sudo yum install glibc.i686

Article author: Andrei Olegovich