Installing Go on Slackware

Page created: 2023-08-05

Slackware comes with gcc-go (Go support for GCC). But I’ve had trouble compiling Go software with it.

Aerc (the TUI mail client) was no exception.

There is a Slackbuild for Go:

https://slackbuilds.org/repository/15.0/development/google-go-lang/

But I’ve done that before and it’s a big package to compile from source.

Luckily, installation from the official pre-built tarball is no problem.

Grab the Linux tarball here: https://go.dev/dl/

Then expand it and copy it over to /usr/local/ and then archive the old gcc-go binaries and symlink the new ones:

$ tar -xf go1.20.7.linux-amd64.tar.gz   # expands into 'go/'
$ sudo cp -R go /usr/local
$ sudo mv /usr/bin/go /usr/bin/go-olde
$ sudo ln -s /usr/local/go/bin/go /usr/local/bin/go
$ sudo mv /usr/bin/gofmt /usr/bin/gofmt-olde
$ sudo ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt

That’s it! You can verify it’s installed correctly by querying its version:

$ go version
go version go1.20.7 linux/amd64