Bad method
It is bad idea. I did extraction as you wrote and I have broken links and can't launch go
:
$ cd /tmp/
$ apt-get download golang-go
$ dpkg -x golang-go_2%3a1.6-1ubuntu4_amd64.deb go
$ tree go -f | grep bin
├── go/usr/bin
│ ├── go/usr/bin/go -> ../lib/go-1.6/bin/go
│ └── go/usr/bin/gofmt -> ../lib/go-1.6/bin/gofmt
$ ./go/usr/bin/go
bash: ./go/usr/bin/go: No such file or directory
You can try other bigger package -
$ apt-get download golang-1.6-go
$ dpkg -x golang-1.6-go_1.6.2-0ubuntu5~16.04.4_amd64.deb go
$ tree go -f | grep bin ├── go/usr/bin
│ ├── go/usr/bin/go -> ../lib/go-1.6/bin/go
│ └── go/usr/bin/gofmt -> ../lib/go-1.6/bin/gofmt
│ ├── go/usr/lib/go-1.6/bin
│ │ ├── go/usr/lib/go-1.6/bin/go
│ │ └── go/usr/lib/go-1.6/bin/gofmt
│ │ │ │ ├── go/usr/lib/go-1.6/pkg/linux_amd64/encoding/binary.a
$ go/usr/bin/go version
go version go1.6.2 linux/amd64
It is better, but what if go would not find some libraries?
Really for working golang
installation you need more packages - see simulation below:
$ apt-get install golang --simulate
NOTE: This is only a simulation!
apt-get needs root privileges for real execution.
Keep also in mind that locking is deactivated,
so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
golang-1.6 golang-1.6-doc golang-1.6-go golang-1.6-race-detector-runtime golang-1.6-src golang-doc golang-go golang-race-detector-runtime
golang-src
Suggested packages:
bzr git mercurial subversion
The following NEW packages will be installed:
golang golang-1.6 golang-1.6-doc golang-1.6-go golang-1.6-race-detector-runtime golang-1.6-src golang-doc golang-go golang-race-detector-runtime
golang-src
0 upgraded, 10 newly installed, 0 to remove and 12 not upgraded.
Good methods
Really you have the following options:
Сreate debootstrap or schroot or Docker container/directory or something similar to isolate Go environment.
Install go
with Snap:
snap install go16-lbo
and test it with
snap run go16-lbo help
Install go1.10
with ubuntu-make:
sudo add-apt-repository ppa:ubuntu-desktop/ubuntu-make
sudo apt-get update
sudo apt-get install ubuntu-make
umake go