Install Go lang and the Bor client on Ubuntu 20.04 lts.
We need at least version 1.19 of Go.
sudo apt-get update
sudo apt-get -y upgrade
mkdir temp
cd temp
wget https://dl.google.com/go/go1.19.linux-amd64.tar.gz
sudo tar -xvf go1.19.linux-amd64.tar.gz
sudo mv go /usr/local
The Go language environment variables we need are GOROOT
, GOPATH
and PATH
.
- Export directly from the terminal; keep in mind that using this method, you'll need to declare them again every time you restart the terminal.
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
- Place the environment variables in the
.bashrc
file. This way, you don't need to declare them every time you restart the terminal.
Open the .bashrc
file.
/bin/nano ~/.bashrc
Add the environment variables at the end of the file.
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
Close and save the file.
Ctrl + x
y
enter
Source the .bashrc
file.
source ~/.bashrc
Now verify that go was installed correctly with the `go version`` command.
go version
Should return something similar to the following.
go version go1.19 linux/amd64
git clone https://github.com/maticnetwork/bor
cd bor
git checkout master
make bor
Verify that Bor was installed correctly.
bor version
It should display the client info.
Bor
Version: 0.2.16-stable
Git Commit: 783f93b1d7ef5e10fcca5a59399ad8b397368e96
Git Commit Date: 20220531
Architecture: amd64
Go Version: go1.19
Operating System: linux
GOPATH=/home/user/go
GOROOT=/usr/local/go