Install Go binary manually
The instructions here work on Linux and macOS and use curl
or wget
to download Go. If you prefer to use a package manager, see this gist.
Download and install from the Go website:
- Find a release on Go site's Downloads page.
- The filename will be:
go$VERSION.$OS-$ARCH.tar.gz
- e.g.
- macOS 64-bit -
go1.14.2.darwin-amd64.tar.gz
- Linux 64-bit -
go1.14.2.linux-amd64.tar.gz
- macOS 64-bit -
- The full URL will be:
https://dl.google.com/go/$FILENAME
- e.g. https://dl.google.com/go/go1.14.2.linux-amd64.tar.gz
- The filename will be:
- Download Go using the URL.
$ cd ~/Downloads $ wget URL $ # Or $ curl -O URL
- Unzip the downloaded tar file. The docs recommend removing the old Go directory first when upgrading.
- Shared directory.
$ sudo rm -rf /usr/local/go $ sudo tar -C /usr/local -xzf TAR_PATH
- Or a user directory.
$ rm -rf ~/.local/go $ tar -C ~/.local/ -xzf TAR_PATH
- Shared directory.
- Set up your path in your shell config (
.profile
,.bashrc
or.zshrc
). There is ago
executable in thebin
directory which must be accessible.- Shared directory.
export PATH="/usr/local/go/bin:$PATH"
- Or a user directory.
export PATH="$HOME/.local/go/bin:$PATH"
- Shared directory.
- Start a new terminal tab and then test your installation:
$ go version
Another option for macOS is to download the installer that is available from the Downloads page and when you open the .pkg
file you'll get an installer GUI. Follow the prompts. It will install to /usr/local/go
and add /usr/local/go/bin
to your path.