2-2: Install Go
Go is the programming language that the Pocket software was written in. So, we'll need to install Go. We could install it using
apt-get but we want to get the latest stable version which probably isn't available in the
apt-get repository. So, we'll use the steps below to install Go.
Make sure you're in the pocket home directory.
Find the latest version of Go from https://golang.org/dl/ then download it with the following command:
go1.17.7.linux-amd64.tar.gzto the most recent version of Go.
Extract the archive
sudo tar -xvf go1.17.7.linux-amd64.tar.gz
Set permissions on the extracted files
sudo chown -R pocket ./go
echo 'export PATH=$PATH:$HOME/go/bin' >> ~/.profile
echo 'export GOPATH=$HOME/go' >> ~/.profile
echo 'export GOBIN=$HOME/go/bin' >> ~/.profile
Verify the installation
You should see something like:
go version go1.17.7 linux/amd64
Note: Make sure the version matches the version you downloaded.
go versiondoesn't work try logging out and logging back in. Then test the
go versioncommand again.
- Verify the
GOBINvariables are set correctlyYou should see the
GOBINvariables set correctly.
If you have issues getting the latest version of Go working, it might be because there is an older version of Go installed with apt-get. To remove the old version of Go, do the following:
sudo apt-get purge golang*
Note: After doing this, you might need to reinstall Go. But first log out and log back in and test with
After you can verify that you have the latest stable version of Go, you're ready to continue.