03 August 2017

Installing Google Cloud Print Connector in Ubuntu 14.04 LTS

As I wanted to be able to print from my phone, I thought the easiest way would be to install Google Cloud Print. Here are the various attempts that I made.

Attempt 1: apt-get

My first attempt was to simply run:
  • sudo apt-get install cloudprint
However, when running it and giving it your user/application pass, it fails with this message:
  • UnboundLocalError: local variable 'auth_response' referenced before assignment
I believe it is because it (v0.5) is trying to hit an api/url that no longer exists.


  • sudo apt-get remove cloudprint

Attempt 2: Compile with gccgo

I then found this wiki about installing a newer version: https://github.com/google/cloud-print-connector/wiki/Build-from-source

So I then installed:
  • go: sudo apt-get install gccgo-go 
  • dev packages: sudo apt-get install build-essential libcups2-dev libavahi-client-dev git bzr
Set your gopath:
  • export GOPATH=$HOME/workspace/gocode
I then attempted to compile the source:
  • go get github.com/google/cloud-print-connector/... 
However I was greeted with two errors:
  • error: unknown field ‘KeepAlive’ in ‘net.Dialer’
  • error: reference to undefined field or method ‘Timeout’
It turns out that the go version that apt-get installs is outdated:
  • go version xgcc (Ubuntu 4.9.3-0ubuntu4) 4.9.3 linux/amd64
  • which is not greater than or equal to version 1.5.2


  • sudo apt-get remove gcc-go

Attempt 3: The correct way

You will still need the dev packages and gopath from attempt 2:
  • sudo apt-get install build-essential libcups2-dev libavahi-client-dev git bzr
  • export GOPATH=$HOME/workspace/gocode
Additionally, we will need an updated version of go:
Now we compile again:
  • go get github.com/google/cloud-print-connector/...
The command should complete with no output.


$GOPATH/bin/gcp-connector-util init