- Run the following commands in terminal:
wget https://dl.google.com/go/go1.17.13.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.17.13.linux-amd64.tar.gz
- Open your
.bashrc
file (~/.bashrc
) in your editor of choice. Add the following lines to the bottom of the file:
export GOPATH="$HOME/go"
export PATH="$PATH:/usr/local/go/bin:$GOPATH/bin"
-
Save the file and exit.
-
Close and re-open any terminal windows.
-
Verify your installation with the command
go version
. The version will be1.17.13
.
- Run the following commands in terminal. If bash is not your default shell, substitute
.bashrc
for the appropriate file (e.g..zshrc
for zsh).
sudo pacman -S go
echo 'export GOPATH="$HOME/go"' >> ~/.bashrc
echo 'export PATH="$PATH:$GOPATH/bin"' >> ~/.bashrc
source ~/.bashrc
- Verify that
go version
shows a go installation of version>1.13.8
.