Install Google’s Go programming language using a proxy

Installing the Go Programming Language is pretty easy, but can be a pain when done behind a firewall and there isn’t one page with all the information necessary. So, here is the one page.

For step: “$ sudo easy_install mercurial”

“mercurial” is probably already in your favorite distro, it is for debian at least. So instead of using the easy_install script, try your distro’s package management app. For debian, apt-get install mercurial did the trick.  If you insist on doing it manually, you might need a proxy statement in your env like:

export http_proxy=”http://user:pass@myproxy.example.com:1234/”

For step: “hg clone -r release https://go.googlecode.com/hg/ $GOROOT”

You should probably have an .hgrc file with proxy information in it, including the user name and password for the proxy (be sure to take the credentials out again after install, and only put em in when using hg again)

———– .hgrc with just the minimum necessary contents —————-
[http_proxy]
# Used to access web-based Mercurial repositories through a HTTP proxy.

host=myproxy:1234

passwd=mysecretpassword

user=myuser
——————————————————-

For step: “$ ./all.bash”

At the moment there are tests ran during the build, requiring network connectivity. There is discussion on the go-nuts mailing list about fixing it,  but until then removing “http” and “net” from tests in the make file:

$GOROOT/src/pkg/Makefile

will get you “Go”-ing again.

To do this, search for NOTEST and add entries “http\” and “net\” to the end, using tabs for the indentation. The complete list should look like the following when complete:
NOTEST=\
debug/proc\
exp/draw\
go/ast\
go/doc\
go/token\
hash\
image\
image/jpeg\
malloc\
rand\
runtime\
syscall\
testing/iotest\
xgb\
http\
net\

Configure Debian apt-get to use a proxy

So it seems configuring apt-get to use a proxy would be a pretty simple thing. The syntax for the entries in ” /etc/apt/apt.conf” are real simple; the HTTP entry, for example, is just:

Acquire::http::Proxy “http://user:password@proxy.example.com:0000″;

However, other forces, on your machine behind the firewall, are at work against you, and you probably put them them there.

If you have set up for using the proxy elsewhere, like setting environment variables:

http_proxy=”http://proxy.example.com:0000″

or

ftp_proxy=”http://proxy.example.com:0000″

in .bashrc or the like

or used Gnome’s  System -> Preferences -> Network Proxy tool to set a proxy server, which do not include the user name and password (or cannot) in the entries, then you are probably feeling the pain I had this morning. It seems that having the environment variables http_proxy and ftp_proxy set, trumps the entry “apt.conf” that can take the user name and password.

So to get it going, add the entries in “apt.conf” with the user name and password (and probably want to remember to take em out after getting updated or whatever) and temporarily remove other proxy server entries from the other places you may stuck them, then get a new shell and you should be happily apt-getting away though the proxy.

Follow

Get every new post delivered to your Inbox.