Wednesday, July 24, 2013

How to install Golang 1.1 in Debian from repository

I like to use packages in Debian - it's easy to update and more stable.
Version of Go language in Debian Wheezy is 1.0.2, but we have 1.1 version in unstable (sid) branch, so let's use it.

Add sources list

It's not safe to just add "unstable" into sources list, so I chose to add it in this way: , I'll quote text of Brendan Byrd here just to save it:

First, create the following files in /etc/apt/preferences.d:
Pin: release l=Debian-Security
Pin-Priority: 1000
Package: *
Pin: release a=stable
Pin-Priority: 995
Package: *
Package: *
Pin: release a=unstable
Pin-Priority: 50
Now, creating a matching set for /etc/apt/sources.list.d:
deb   stable/updates  main contrib non-free
deb  testing/updates main contrib non-free
deb    stable main contrib non-free
deb-src    stable main contrib non-free
unstable.list: Same as stable.list, except with unstable.


Then run apt-get update and, finally:
aptitude install golang/unstable


Check version:
go version

And check code execution like described in

1 comment: