08 April 2018 | 1 min read

Installing go1.10.1 (Fedora 27)

I had problem with current version of Go that available on Fedora 27 repository

$ dnf info golang
Last metadata expiration check: 21 days, 11:46:56 ago on Sat 17 Mar 2018 11:15:37 PM +08.
Available Packages
Name         : golang
Version      : 1.9.4
Release      : 1.fc27
Arch         : x86_64
Size         : 622 k
Source       : golang-1.9.4-1.fc27.src.rpm
Repo         : updates
Summary      : The Go Programming Language
URL          : http://golang.org/
License      : BSD and Public Domain
Description  : The Go Programming Language.

I unable to install any library with go get command

$ go version
go version go1.9.4 linux/amd64

$ go get github.com/andlabs/ui
go build github.com/andlabs/ui: invalid flag in #cgo LDFLAGS: /home/rnm/Workspaces/Golang/src/github.com/andlabs/ui/libui_linux_amd64.a

$ go get github.com/pebbe/tokenize
go build github.com/pebbe/tokenize: invalid flag in #cgo CFLAGS: -finput-charset=UTF-8

Instead of downgrade as per suggested here , I decide to remove Golang package from Fedora repository and install the newest binary by myself.

$ sudo dnf remove golang
$ wget https://dl.google.com/go/go1.10.1.linux-amd64.tar.gz
$ sudo tar -C /usr/local -xzf go1.10.1.linux-amd64.tar.gz 
$ echo 'export PATH=$PATH:/usr/local/go/bin' >> $HOME/.bashrc
$ source ~/.bashrc

Boom! Now you can use it,meh… pretty simple.

Robbi Nespu | DNF, Fedora, Golang, Linux, Programming


Discussion and feedback