Get the dependencies
curl -LO https://go.dev/dl/go1.19.5.linux-amd64.tar.gz
Remove any previous Go installation, then extract the archive you just downloaded into /usr/local
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.19.5.linux-amd64.tar.gz
NOTICE
For any permission related issues, try running the below command
sudo chown -R $(whoami) /usr/local
Add /usr/local/go/bin to the PATH environment variable
export PATH=$PATH:/usr/local/go/bin
Verify go installation
go version