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.
cd ~Find the latest version of Go from https://golang.org/dl/ then download it with the following command:
wget https://dl.google.com/go/go1.17.7.linux-amd64.tar.gzNote: Change
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.gzSet permissions on the extracted files
sudo chown -R pocket ./goSet the
PATHvariableecho 'export PATH=$PATH:$HOME/go/bin' >> ~/.profileSet the
GOPATHandGOBINvariablesecho 'export GOPATH=$HOME/go' >> ~/.profileecho 'export GOBIN=$HOME/go/bin' >> ~/.profileSource the
.profilesource ~/.profileVerify the installation
go versionYou should see something like:
go version go1.17.7 linux/amd64Note: Make sure the version matches the version you downloaded.
tipIf
go versiondoesn't work try logging out and logging back in. Then test thego versioncommand again.
- Verify the
GOPATHandGOBINvariables are set correctlyYou should see thego envGOPATHandGOBINvariables set correctly.
Having issues?
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
go version.
After you can verify that you have the latest stable version of Go, you're ready to continue.