Is there a way to download go1.18 in debian/rules?

Asked by Lonny Wong

My program have to build with go1.18.

I want to wget go1.18 in the debian/rules.

 wget -P /tmp
 tar -C /tmp -xzf /tmp/go1.18.3.linux-amd64.tar.gz
 PATH=/tmp/go/bin:${PATH} dh_auto_build

But I got an error:

Resolving ( failed: Name or service not known.
wget: unable to resolve host address ‘’

Thanks for your help.

Question information

English Edit question
Launchpad itself Edit question
No assignee Edit question
Solved by:
Colin Watson
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :

Manfred Hampl suggests this article as an answer to your question:
FAQ #167: “My build fails because it can't connect or download from an external URL”.

Revision history for this message
Lonny Wong (lonnywong) said :

Could I use snap to install go1.18 as Build-Depends?

In the debian/control:

Build-Depends: debhelper (>=9),

Where to run "sudo systemctl start snapd.service" and "sudo snap install go --classic" ?

Revision history for this message
Best Colin Watson (cjwatson) said :

Neither general internet access nor installing snaps is permitted in .deb package builds. You'd need to either backport golang-1.18 to trusty yourself, or edit your PPA's dependencies to use another PPA where somebody has already done that. I don't know of one specifically (trusty is a long way back - do you really need to keep supporting that?), but maybe something in will be helpful.

Revision history for this message
Lonny Wong (lonnywong) said :

Thanks Colin Watson, that solved my question.